Azure DevOps Nuget 管道步骤中的 Nuget 包说明 [英] Nuget package description in the Azure DevOps Nuget pipeline step
问题描述
是否可以为 Azure DevOps Pipeline 中添加的 NuGet 包添加描述?
Is it possible to add a description for the NuGet package being added in the Azure DevOps Pipeline?
推荐答案
Azure DevOps Nuget 管道步骤中的 Nuget 包说明
Nuget package description in the Azure DevOps Nuget pipeline step
众所周知,当我们用.csproj
文件打包nuget包时,nuget会从项目中的AssemblyInfo.cs
文件中获取包信息,比如assembly: AssemblyVersion
, assembly: AssemblyDescription
等等.
As we know, when we pack the nuget package with .csproj
file, nuget will get the package info from the file AssemblyInfo.cs
in the project, like assembly: AssemblyVersion
, assembly: AssemblyDescription
and so on.
所以,要为 NuGet 包添加描述,我们可以在 AssemblyInfo.cs
中添加 assembly: AssemblyDescription
的描述:
So, to add a description for the NuGet package, we could add the description for assembly: AssemblyDescription
in the AssemblyInfo.cs
:
[assembly: AssemblyDescription("This is Test Decription!!!")]
然后将此更新推送到 Azure DevOps 存储库,在这种情况下,我们可以使用该描述打包包.
Then push this update in to the Azure DevOps repos, in this case, we could pack the package with that description.
另外,如果你想使用 .nuspec
文件,我们需要在本地机器上使用命令行创建这个文件 nuget spec "..*.csproj"
,然后修改.nuspec
中的<description>$description$</description>
,将此文件上传到repos.
Besides, if you want use the .nuspec
file, we need create this file on local machine with the command line nuget spec "..*.csproj"
, then modify the <description>$description$</description>
in the .nuspec
, upload this file to the repos.
查看文档创建 NuGet 包 创建 .nuspec
文件.
Check the document Creating NuGet packages to create the .nuspec
file.
希望这会有所帮助.
这篇关于Azure DevOps Nuget 管道步骤中的 Nuget 包说明的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!