gpt4 book ai didi

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

转载 作者:行者123 更新时间:2023-12-02 20:30:06 25 4
gpt4 key购买 nike

使用 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.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 参数路径末尾的反斜杠导致它选择“调试”而不是“发布”。难怪我花了 4 个小时才从失败的 TFS Nuget Packager 步骤缩小范围。不好笑。

关于nuget - 为什么 NuGet.exe 包忽略 Configuration=Release 参数?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/49074072/

25 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com