I have a Class Library project using .net Framework 4.6.1 and I am building a NuGet package using Azure Pipelines. I have got most of the fields in the NuGet package properties populated however I'm struggling with a few.
I'm using an extension to read the AssemblyVersion from AssemblyInfo.cs and use this for the versioning.
I can also see that it extracts the below fields form AssemblyInfo.cs
| AssemblyInfo.cs Field | NuGet Package Property |
|---|---|
| AssemblyTitle | Title |
| AssemblyDescription | Description |
| AssemblyCompany | Authors |
| AssemblyProduct | ID |
| AssemblyCopyright | Copyright |
The NuGet fields I'm trying to populate are Release Notes, Summary & Owners but I'm not sure where to start. I've look at what other fields I can use in AssemblyInfo and none of them sound like they would relate to the mentioned fields. I've also looked in the NuGet Pack task in Azure Pipelines but theres no mention of these fields either
When we pack the nuget package with
.csprojfile, nuget will get the package info from theAssemblyInfo.csfile in the project. (e.g:AssemblyVersion,AssemblyDescription,AssemblyCopyrightetc).We can see this information in the package overview page after it's published to a feed.
Here is the direction for your reference. We can try to add this as a description for the NuGet package, we could add the description for
assembly: AssemblyDescriptionin theAssemblyInfo.cs:However, we need to find a way to generate the required information (
Release Notes, Summary, ect) and write it to theAssemblyInfo.csfile.Another way is using the
.nuspecfile. We need to create this file on local machine with the command linenuget spec "..\*.csproj", then modify the<description>$description$</description>in the.nuspec, upload this file to the repos. Please see Create the .nuspec file for details.After that, we can expand the "
Advanced" option of the NuGet Pack task, then in the "Additional build properties" specify the value you want in this way:With this way, the specified value will replace description.