Home: Recursive nuget restore

Created on 13 Apr 2016  路  5Comments  路  Source: NuGet/Home

Suppose I want to restore all NuGet dependencies of a project and then build it. So I go

nuget restore foo.csproj
msbuild foo.csproj

Hover, if foo.csproj is dependent on bar.csproj which has its own (different) NuGet dependencies that won't work. The NuGet restore operation will only restore the foo.csproj dependencies.

I suggest a new -Recursive flag to nuget restore which will recursively restore all descendant dependencies, as to allow the scenario outlined above.

Restore NuGet.exe Feature

Most helpful comment

Fixed as part of https://github.com/NuGet/Home/issues/3577

Use nuget.exe restore foo.csproj -recursive

All 5 comments

You can already restore a solution, or a folder with many csproj files. Is that not sufficient?

Can you help spell out the exact scenario you are hitting?

Suppose you have a folder with 100 csproj files, and a solution referencing those projects. You could restore the entire folder (either by restoring the sln or *.csproj) but that would be wasteful if you just wanted to build foo.csproj.

Just as msbuild knows to build a csproj recursively, building all dependencies first, ideally so should nuget restore, so I could go

nuget restore foo.csproj
msbuild foo.csproj

In that folder and only restore + build foo.csproj and its dependencies (say bar.csproj).

Makes sense, will keep on our backlog

@emgarten I believe you already tackled this one, can you please validate my assessment and update the issue accordingly?

Fixed as part of https://github.com/NuGet/Home/issues/3577

Use nuget.exe restore foo.csproj -recursive

Was this page helpful?
0 / 5 - 0 ratings

Related issues

jainaashish picture jainaashish  路  3Comments

LordMike picture LordMike  路  3Comments

blackcity picture blackcity  路  3Comments

vsfeedback picture vsfeedback  路  3Comments

philippe-lavoie picture philippe-lavoie  路  3Comments