1

Details about Problem

When uploading a package to nuget.org manually via the website, I can set a documentation URL that points to a readme file on github, as shown here: https://www.nuget.org/packages/blazor-server-githubactions-demo/ How do I this via a .csproject file, as I use CI / CD to publish my packages and so I don't want this to be a manual step. how publish readme file automatically along with pacakge.

1 Answers1

1

I didn't try, but according to this blog post from Microsoft, I'd expect the following to work

  1. Create README.md in your repo.
  2. Ensure your csproj file looks like this:
<Project Sdk="Microsoft.NET.Sdk">
    <PropertyGroup>
        ...
        <PackageReadmeFile>README.md</PackageReadmeFile>
        ...
    </PropertyGroup>

    <ItemGroup>
        ...
        <None Include="docs\README.md" Pack="true" PackagePath="\"/>
        ...
    </ItemGroup>
</Project>

This should configure everything in your NuGet package, so that it gets picked up when being uploaded to nuget.org.

mu88
  • 4,156
  • 1
  • 23
  • 47
  • Thanks @mu88. I tried the same thing but i didn't see the readme.md file in nuget.org. – mohankrishna May 30 '22 at 06:35
  • And is it present in your NuGet package (`docs\README.md`)? If not, can you try it with the mentioned Preview version of .NET 6? – mu88 May 30 '22 at 06:38
  • I change the version of .NET from 3.1.101 to 6.0.x. its working now readme.md file publish automatically along with package. Thanks @mu88 – mohankrishna May 31 '22 at 05:37
  • Cool, I'm happy I could help :) If this suffices your needs, please consider accepting it as an answer so that the question gets closed – mu88 May 31 '22 at 05:54