我的包构建成功并上传到VSTS中的Packages feed但是我似乎无法弄清楚如何编辑包的描述和作者,以便我的设置值显示在Package feed中。
根据我的阅读,我将我的内容放在NuGet Packager的其他构建属性下,当我查看日志文件时,我看到了:
...NuGet.exe pack "...csproj" -OutputDirectory "..." -Properties Configuration=release;Description="My Description";Authors="Me";Owners="My Company"
从文档中我相信我做得对(但显然我没有)。对于“附加构建属性”与NuGet Arguments中的内容,似乎有点令人困惑。
我的目标是获取我设置为可在Visual Studio中的NuGet包管理器中查看的描述和作者。
答案 0 :(得分:2)
您可以根据.nuspec文件创建包。 步骤进行:
例如:(包括作者和描述标记)
<?xml version="1.0"?>
<package >
<metadata>
<id>CommLib1</id>
<version>1.0.0.6</version>
<title>CommLib1</title>
<authors>$author$</authors>
<owners>$author$</owners>
<licenseUrl>http://LICENSE_URL_HERE_OR_DELETE_THIS_LINE</licenseUrl>
<projectUrl>http://PROJECT_URL_HERE_OR_DELETE_THIS_LINE</projectUrl>
<iconUrl>http://ICON_URL_HERE_OR_DELETE_THIS_LINE</iconUrl>
<requireLicenseAcceptance>false</requireLicenseAcceptance>
<description>$description$</description>
<releaseNotes>Summary of changes made in this release of the package.</releaseNotes>
<copyright>Copyright 2016</copyright>
<tags>Tag1 Tag2</tags>
</metadata>
</package>
UPDATE1:
通常,您只需要更新项目的AssemblyInfo.cs文件(Author =&gt; AssemblyCompany; Description =&gt; AssemblyDescription; Version =&gt; AssemblyVersion),它会根据此数据创建包,除非它可以&#39 ; t从程序集中检索元数据(我有一个项目有此问题)。
所以,步骤:
确保nuget可以通过nuget.exe命令直接在本地/构建机器中创建包来检索必要的元数据(nuget pack [XX] .csproj)
创建构建定义(1. Visual Studio Build 2. Nuget Packager,默认值为3. Nuget Publisher)
答案 1 :(得分:1)
如果它正在构建软件包,那么NuGet Packager构建步骤就没有问题了。但有两件事需要改变。
有关* .nuspec文件的更多详细信息,请参阅此处的解决方案:
Nuget.exe pack WARNING: Description was not specified. Using 'Description'