[英]nuget command to IncludeReferencedProjects in azure devops
在 Azure devops 中,我想发出一个传递选项IncludeReferencedProjects
的 nuget pack 命令。 我的仓库在 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.
如何使用可视化设计器使用IncludeReferencedProjects
标志打包所有 csproj 输出? 这是我在设计师中的图片:
如何使用可视设计器将所有csproj输出与IncludeReferencedProjects标志一起打包?
恐怕您无法使用IncludeReferencedProjects标志打包所有 csproj输出。
那是因为pack命令(NuGet CLI) 不支持通配符 。
当您将nuget pack命令行与通配符一起使用时,将始终收到错误Unknown command: '**\\*.csproj'
。 (此错误在本地也存在。)
要解决此问题,我们可以添加多个nuget打包任务来打包这些项目。
希望这可以帮助。
对我来说,传递IncludeReferencedProjects=true
有效。
- task: DotNetCoreCLI@2
displayName: Pack Core.Shared
inputs:
command: 'pack'
packagesToPack: '**/*.csproj'
versioningScheme: 'byPrereleaseNumber'
majorVersion: '1'
minorVersion: '0'
patchVersion: '0'
buildProperties: 'IncludeReferencedProjects=true'
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.