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

后端 未结 2 514
傲寒
傲寒 2021-02-05 00:56

I consider it generally good practice to include the XML documentation file generated by the C# build in NuGet packages alongside the DLLs to provide intellisense documentation

2条回答
  •  滥情空心
    2021-02-05 01:35

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

    
    
      
        netstandard2.0
        true
      
    
    
    

    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.

提交回复
热议问题