1

I've developed a C# library and published it onto NuGet. To make it easier for others to use, I've also added some documentation using <summary> tags, for example like this:

    /// <summary>
    /// This method does X and Y and accepts the parameter Z.
    /// </summary>

When testing locally (two projects in one solution), I can clearly see them when intellisense suggests me the class/method. However, when compiling for a release, the documentation of my library is for some reason omitted. When I download the released library in a different solution trough NuGet, I no longer see any of the documentation when intellisense starts suggesting.

I use the newest .NET version to compile (6.0.302) on Linux and use the following command to build and pack the project:

dotnet build && dotnet pack --configuration Release
  • 4
    Make sure you are outputting an "XML documentation file" (project properties\build). This xml file need to be included in your nuget package, this might be done by default, or not, depending on how nuget is configured. – JonasH Aug 01 '22 at 12:35
  • 1
    [This might help](https://snede.net/add-nuget-package-xml-documentation-to-swagger/#:~:text=Including%20XML%20documentation%20into%20a%20NuGet%20package%20is,PropertyGroup%20into%20your%20nuget%20package.csproj%20file%3A%20%3CPropertyGroup%3E%20%3CGenerateDocumentationFile%3Etrue%3C%2FGenerateDocumentationFile%3E) Or [try this](https://makolyte.com/how-to-generate-xml-documentation-and-include-it-in-a-nuget-package/) – Matthew Watson Aug 01 '22 at 12:40
  • 1
    Does this answer your question? [How do you include Xml Docs for a class library in a NuGet package?](https://stackoverflow.com/questions/5205738/how-do-you-include-xml-docs-for-a-class-library-in-a-nuget-package) – nilsK Aug 01 '22 at 13:15

0 Answers0