lonix
lonix

Reputation: 20569

Nuget PackageReleaseNotes as link instead of static text

I can successfully create a nuget package.

I have this:

<PackageReleaseNotes>See https://github.com/foo/bar/CHANGELOG.md</PackageReleaseNotes>

That renders as static text. Can I configure it to render as a link instead?

Upvotes: 3

Views: 965

Answers (1)

Igor Levicki
Igor Levicki

Reputation: 1586

As far as I know, NuGet does not support rich text format in PackageReleaseNotes (nor does it support fetching content from link or file) yet. There is an NuGet issue related to this problem which links to other relevant issues (GUI, etc).

There is a nice little trick which can be used in .csproj file though. For example, if you have a ReleaseNotes.txt file:

1.0.5 Release (2022-09-20)

 - Changed foo

1.0.4 Release (2022-08-13)

 - Changed bar

1.0.0 Release (2022-01-15)

 - Initial release

Then you can use this snippet in your .csproj file:

<PackageReleaseNotes>$([System.IO.File]::ReadAllText("$(MSBuildProjectDirectory)/ReleaseNotes.txt"))</PackageReleaseNotes>

To inject its contents into the package .nuspec on build. Of course, you need to make sure to actually update release notes before hitting Build.

Upvotes: 4

Related Questions