How to include XML documentation file in NuGet package built from a project file?

As long as you set GenerateDocumentationFile in your csproj file like this:

<Project Sdk="Microsoft.NET.Sdk">

  <PropertyGroup>
    <TargetFramework>netstandard2.0</TargetFramework>
    <GenerateDocumentationFile>true</GenerateDocumentationFile>
  </PropertyGroup>

</Project>

then all the defaults will generate the documentation file at the correct location and it will be included in the NuGet package.

If Visual Studio added DocumentationFile or other elements, you can delete them and replace it with the single GenerateDocumentationFile property.

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)