# How To Add Release Notes to Nuget Package

These are the steps needed to include release notes in a Nuget package.

These are taken from this article:  
<span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="https://medium.com/@z2hteam/writing-a-nuget-package-release-notes-in-an-outside-of-a-csproj-file-be0e7fd040a2" data-inline-card="true" data-renderer-start-pos="109" data-ssr-placeholder="0vDZ-:EfLS5:4y5Pz:qz-Pe:F4Zdx-0"><span class="loader-wrapper"><span data-testid="hover-card-trigger-wrapper">[<span class="_19itglyw _vchhusvi _r06hglyw _o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66" data-testid="inline-card-icon-and-title"><span class="_19itglyw _vchhusvi _r06hglyw">Writing a NuGet package release notes in an outside of a .csproj file.</span></span>](https://medium.com/@z2hteam/writing-a-nuget-package-release-notes-in-an-outside-of-a-csproj-file-be0e7fd040a2)</span></span></span>   
Same article here:  
<span data-annotation-inline-node="true" data-annotation-mark="true" data-card-url="https://dev.to/j_sakamoto/writing-a-nuget-package-release-notes-in-an-outside-of-a-csproj-file-3f94" data-inline-card="true" data-renderer-start-pos="131" data-ssr-placeholder="0vDZ-:EfLS5:4y5Pz:qz-Pe:F4Zdx-1"><span class="loader-wrapper"><span data-testid="hover-card-trigger-wrapper">[<span class="_19itglyw _vchhusvi _r06hglyw _o5721jtm _1nmz9jpi _16d9qvcn _ca0qv77o _u5f31b66 _n3tdv77o _19bv1b66" data-testid="inline-card-icon-and-title"><span class="_19itglyw _vchhusvi _r06hglyw">Writing a NuGet package release notes in an outside of a .csproj file.</span></span>](https://dev.to/j_sakamoto/writing-a-nuget-package-release-notes-in-an-outside-of-a-csproj-file-3f94)</span></span></span>

Release Notes are kept in the VS solution with the project, but are not stored inside the project.

A target block is added to the csproj file so that MSBuild can include the release notes content into the nuget package.

### How To

1. Create a text file in the VS Solution, called: `RELEASE-NOTES.txt`, or something more specific, if more than one release notes file is needed.
2. Place the release notes file outside the project node, but still in the VS Solution, such as this:

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/scaled-1680-/g8RUzyfvE96EdkaI-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/g8RUzyfvE96EdkaI-image.png)

3\. Add content to the release notes file, to annotate each version in descending order, like this:

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/scaled-1680-/oo2zyvKEfPW5Miy0-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/oo2zyvKEfPW5Miy0-image.png)

4\. Add a comment in the Assembly Release Notes field, to point other developers to use the Release Notes.txt file.

This can be done by writing a comment in the PackageReleaseNotes MSBuild property, via the Project property editor GUI, or editing the csproj file.

We do this first, before we add the MSBuild target to the csproj file, to ensure the release notes property is set.

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/scaled-1680-/P8CKswy4BauLOxUL-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/P8CKswy4BauLOxUL-image.png)

5\. Now, we need to create a MSBuild Target (like the below screenshot) in the csproj file so that MSBuild can pick up the release notes before the nuget package is built.

This action needs to be executed before the “GenerateNuspec” target is executed.

At the before executing of the “GenerateNuspec” target is a good entry point to prepare the package release notes.

This target reads the release notes file contents by “ReadLinesFromFile” MSBuild standard task, and outputs the contents into a MSBuild items which is named, ReleaseNoteLines.

Finally, MSBuild will build the PackageReleaseNotes MSBuild property from the ReleaseNoteLines MSBuild items that contain the contents of the release notes file.

By the way, MSBuild joins the items with a “;” separate by default.

In this case, we want to make PackageReleaseNotes MSBuild property with multi-lines, therefore we write the reference of ReleaseNoteLines MSBuild itens with “LF” (Line-Feed) separate explicitly, like this:

`@(ReleaseNoteLines, '%0a')`

(`'%0a'` means `LF` code in an MSBuild script file.)

Here’s what the MSBuild target looks like:

```xml
<Target Name="PreparePackageReleaseNotesFromFile" BeforeTargets="GenerateNuspec">
 <ReadLinesFromFile File="../RELEASE-NOTES.txt" >
 <Output TaskParameter="Lines" ItemName="ReleaseNoteLines"/>
 </ReadLinesFromFile>
 <PropertyGroup>
 <PackageReleaseNotes>@(ReleaseNoteLines, '%0a')</PackageReleaseNotes>
 </PropertyGroup>
</Target>
```

This build target needs to be pasted into the csproj file, like this:

[![image.png](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/scaled-1680-/Wrssp16RYqFN1VaJ-image.png)](https://wiki.galaxydump.com/uploads/images/gallery/2025-08/Wrssp16RYqFN1VaJ-image.png)

6\. Build the project, and push the nuget package to a repository to confirm it contains release notes.