为什么NuGet.exe打包忽略Configuration = Release参数?

问题描述 投票:0回答:1

使用nuget.exe打包应用程序,我将Release指定为配置,但它失败并显示“确保项目已构建”。因为它在Debug文件夹中查找,而不是Release文件夹:

NuGet.exe pack "C:\dev\Test\WpfApp1.csproj" -OutputDirectory "C:\dev\a\packages\" -Properties Configuration=Release

Attempting to build package from 'WpfApp1.csproj'.

Unable to find 'C:\dev\Test\bin\Debug\WpfApp1.exe'. Make sure the project has been built.

为什么?

nuget
1个回答
2
投票

经过多次试验和错误,我发现了它。指出不同?:

NuGet.exe pack "C:\dev\Test\WpfApp1.csproj" -OutputDirectory "C:\dev\a\packages" -Properties Configuration=Release

Attempting to build package from 'WpfApp1.csproj'.

Packing files from 'C:\dev\Test\bin\Release'.

是的,OutputDirectory参数路径末尾的反斜杠导致它选择Debug而不是Release。难怪我花了4个小时从失败的TFS Nuget Packager步骤缩小范围。不好笑。

© www.soinside.com 2019 - 2024. All rights reserved.