NuGet.exe restore: allow specifying Solution Configuration to use for .sln, for example -Properties similar to pack.
#7575 aperta il 1 dic 2018
Metriche repository
- Star
- (1459 star)
- Metriche merge PR
- (Merge medio 464g 23h) (1 PR mergiata in 30 g)
Descrizione
Details about Problem
NuGet product used: NuGet.exe
NuGet version (x.x.x.xxx): 4.9.1.5694
dotnet.exe --version (if appropriate): 2.2.0-preview1-007622
VS version (if appropriate): 15.9.2
OS version (i.e. win10 v1607 (14393.321)): Win10
Worked before? If so, with which NuGet version: not a regression
Detailed repro steps so we can see the same problem
Have an .sln file with two configurations: Debug and Release. Have a project that only fails to build in Debug.
You should be able to restore nuget packages by specifying:
nuget restore My.sln /Configuration Release
Currently restore fails because nuget chooses the default (Debug) configuration which doesn't build.
Unfortunately the workaround of using msbuild /r /p:Configuration=Release or dotnet restore doesn't work because many solutions still include projects that have no understanding of NuGet, and so the Restore target isn't there.