简体   繁体   English

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

[英]Why is NuGet.exe pack ignoring the Configuration=Release parameter?

Using nuget.exe to package an application, I specify Release as the configuration, but it fails with "Make sure the project has been built." 使用nuget.exe打包应用程序,我将Release指定为配置,但是失败并显示“确保已构建项目”。 because it's looking in the Debug folder, not the Release folder: 因为它在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.

Why? 为什么?

After much trial and error I figured it out. 经过反复试验,我弄清楚了。 Spot the difference?: 指出不同?:

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'.

Yes, a back slash at the end of the path of the OutputDirectory parameter caused it to choose Debug instead of Release. 是的,OutputDirectory参数路径末尾的反斜杠导致其选择Debug而不是Release。 No wonder it took me 4 hours to narrow it down from the failing TFS Nuget Packager step. 难怪我花了四个小时才将其从失败的TFS Nuget Packager步骤缩小到缩小范围。 Not funny. 不好笑。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM