Azure DevOps Nuget管道步骤中的Nuget程序包描述 [英] Nuget package description in the Azure DevOps Nuget pipeline step
问题描述
是否可以为在Azure DevOps管道中添加的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
我们知道,当我们将nuget软件包与.csproj
文件打包在一起时,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>
,将此文件上传到存储库.
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
文件.
希望这会有所帮助.
这篇关于Azure DevOps Nuget管道步骤中的Nuget程序包描述的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!