NuGet.exe restore: allow specifying Solution Configuration to use for .sln, for example -Properties similar to pack.
#7,575 创建于 2018年12月1日
仓库指标
- Star
- (1,459 star)
- PR 合并指标
- (平均合并 464天 23小时) (30 天内合并 1 个 PR)
描述
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.