nuget 命令在 azure devops 中 IncludeReferencedProjects

use*_*430 6 azure nuget azure-devops

在Azure devops中,我想发出一个传递选项的nuget pack命令IncludeReferencedProjects。我的存储库位于 TFVC 中,所以我不相信我可以使用 azure-pipelines.yml。我相信我必须通过视觉设计师来做到这一点。我没有看到使用 pack 命令类型将附加参数传递给 nuget 的选项。这让我觉得我必须使用 nuget 的自定义命令类型。当我使用自定义命令类型时,我可以指定 -IncludeReferencedProjects 但我似乎无法指定 **\*.csproj 作为要打包的项目。如果我这样做,命令将失败并显示:

[command]C:\hostedtoolcache\windows\NuGet\4.1.0\x64\nuget.exe pack **\*.csproj -IncludeReferencedProjects -Symbols -Verbosity Detailed -NonInteractive
System.IO.IOException: The filename, directory name, or volume label syntax is incorrect.
Run Code Online (Sandbox Code Playgroud)

如何IncludeReferencedProjects使用可视化设计器将所有 csproj 输出与该标志打包?这是我在设计师中拥有的图片:

在此输入图像描述

Leo*_*SFT 1

如何使用可视化设计器将所有 csproj 输出与 IncludeReferencedProjects 标志一起打包?

恐怕您无法使用 IncludeReferencedProjects 标志打包所有csproj 输出。

这是因为pack 命令(NuGet CLI) 不支持通配符

当您使用带有通配符的 nuget pack 命令行时,您将始终收到错误Unknown command: '**\*.csproj'。(本地也存在这个错误。)

为了解决这个问题,我们可以添加多个 nuget pack 任务来打包这些项目。

希望这可以帮助。