How to include a documentation file when creating a Nuget package

47729319 1 Reputation point
2022-02-07T06:16:29.03+00:00

I'm trying to create a Nuget package using MSBuild. I would like to include documentation files (html, pdf) in this Nuget package, is there any way to do this without using nuspec files?

Community Center Not monitored
Developer technologies C#
0 comments No comments
{count} votes

2 answers

Sort by: Most helpful
  1. Anna Xiu-MSFT 31,056 Reputation points Microsoft External Staff
    2022-02-08T09:30:49.953+00:00

    Hi @47729319 ,

    Welcome to Microsoft Q&A!

    For your requirement, you can refer to the following property in your .csproj file:

    <Project Sdk="Microsoft.NET.Sdk">  
      
      <PropertyGroup>  
        <TargetFramework>netstandard2.0</TargetFramework>  
        <GenerateDocumentationFile>true</GenerateDocumentationFile>  
      </PropertyGroup>  
      
    </Project>  
    

    Sincerely,
    Anna
    *
    If the answer is the right solution, please click "Accept Answer" and kindly upvote it. If you have extra questions about this answer, please click "Comment".
    Note: Please follow the steps in our documentation to enable e-mail notifications if you want to receive the related email notification for this thread.

    0 comments No comments

  2. Karen Payne MVP 35,586 Reputation points Volunteer Moderator
    2022-02-08T10:16:17.913+00:00

    No, only text files and .md files.

    A better idea is to use DocFx.

    0 comments No comments

Your answer

Answers can be marked as Accepted Answers by the question author, which helps users to know the answer solved the author's problem.