Search code examples
msbuildnugetdotnet-cli

Specify markdown description in csproj file


When using dotnet pack, I can use properties like RepositoryUrl to use as the resulting .nuspec file's repository URL etc.

But what property do I set to specify markdown content? Is it even possible to specify via .csproj files?

If not, how do I do it in a .nuspec file? The documentation is very lacking. According to this link, some interns have apparently published the feature - but how do I use it?


Solution

  • Update: You can use NuspecProperties as a Semicolon separated list of key=value pairs. Here the complete command reference for csproj, in particular you have to set the documentation property as below reference:

    According to this Nuspec documentation

    You can specify the property documentation <documentation src="documentation.md" /> in your .nuspec file.

    • target defaults to package root
    • Supported formats - md
    • On pack, strip source value, append the target value with the source file name - <documentation target="documentation.md"/>. (this is to help the gallery and the client know the path to the documentation file in the package and the file name.extension. Allows for extension validation, etc.)
    • nuget spec will add <!-- e.g. <documentation src="documentation.md"/>. Learn more at https://aka.ms/nugetPackageDocumentation--> <documentation src=""/>

    • package submitted to NuGet.org - target should not be null

    Sidenote: this answer comes with a documentation resource published later than when the question was asked.