NuGet/Home

NuGet.exe restore: allow specifying Solution Configuration to use for .sln, for example -Properties similar to pack.

Open

#7,575 opened on 2018年12月1日

GitHub で見る
 (11 comments) (7 reactions) (0 assignees)HTML (292 forks)batch import
Priority:2Product:NuGet.exeStyle:PackageReferenceStyle:Packages.ConfigType:Featurehelp wanted

Repository metrics

Stars
 (1,459 stars)
PR merge metrics
 (平均マージ 464d 23h) (30d で 1 merged 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.

コントリビューターガイド