An essential part of working on open-source libraries is conveying the value and useability of said library—a well-written “readme” file, while not a substitute for complete documentation, can help onboard new users and increase the joy of using your code.

Regarding NuGet packages, you can now add a asset to your NuGet packages, which will display on your package’s landing page, thus giving you another medium to attract new users and inform the curious developer. For example, check out my library HTMX.NET landing page, which now has the read me prominently displayed.

Let’s see what steps you must take to accomplish the same in your libraries.

The Readme File

Typically, at the root of every open-source repository should be a file. The inclusion of the file has become a convention across GitHub, GitLab, and most distributed source control offerings. Your source control’s user interface will display the readme to repository visitors, allowing them to read your perspective and introductory notes.

As an aside, a good readme should answer three essential questions:

  1. What is this project? A statement of intent and what the ultimate goal of the repository is trying to accomplish goes a long way.
  2. How do I get started? This includes where to get the library, possibly building the source, or acessing the library through a package manager.
  3. What are some common use cases? While you can’t account for all scenarios, there are likely common use cases your users will encounter. Spell them out. If there are known edge cases, spell those out too.

When adding the to your .NET repository, you’ll want to link it to each project that is packagable. Checkout out my NuGet guide here if you’re unfamiliar with setting up .NET projects for NuGet.

Updating The Package Project

The way I accomplish this is by using the Link functionality in a csproj file. Let’s take a look at what that might look like.

    <None Remove="antiforgerySnippet.js" />
    <None Include="..\..\icon.png" Pack="true" PackagePath="">
    <!-- IMPORTANT: adding the Readme as a link -->
    <None Include="..\..\" Pack="true" PackagePath="">

The link can point to anywhere in your project, but I place most of my linked resources inside of the Properties folder to keep the visual clutter to a minnimum. You’ll also need to have the Pack attribute set to true and the PackagePath is set to the NuGet package root. I also have a package icon in this item group, which I also recommend adding.

Next, you’ll need to add some additional elements to your project’s PropertyGroup element, with the important tags for this tutorial being PackageReadmeFile. I’ve included a complete PropertyGroup section to see how it fits in with all the other Package* elements.

The PackageReadmeFile requires the path to the file within the NuGet package. Do not confuse this with where you place the file in your project.

    <Authors>Khalid Abuhakmeh</Authors>
    <!-- IMPORTANT Do not forget this -->
        Adds ASP.NET Core tag helpers to make generating urls for Htmx ( easier. Mimics the ASP.NET Core url tag helpers.

If you’ve followed these steps correctly, then you should have a visible Readme on your NuGet packages home page. Congratulations! 🎉

Side Note: will not respective relatively-linked resources such as images. If your file uses image references, be sure to have absolute paths to the images or else you’ll have an incomplete readme on


There you have it! With the use of a Readme file, a Link element, and PackageReadmeFile element you too can have a better looking NuGet package page. It can give you and your package a greater chance of being picked and it can help grow your little corner of the .NET community.

As always, thanks for reading and sharing my posts with friends and colleagues.