Empresas
Empregos
  • Sobre nós
  • Soluções
    • Publicação de vagas
      Publique sua vaga e receba candidatos qualificados em 48h.
    • Avaliações de candidatos
      Mais de 500 testes técnicos e psicológicos, mais anti-fraude.
    • Headhunting
      Busca executiva personalizada do início ao fim.
    • Folha de Pagamento + EOR
      Dispersão de folha e EOR em mais de 15 países da LATAM.
  • Preços
  • Empregos

0

392
Visualizações
Show comments in nuget package

How do I include the comments that I write above my methods and properties in my nuget package? Ie. So when the library is consumed the user can use intellisense and read what the method is about?

eg. if I have the method

/// <summary>
/// This method does such and such
/// </summary>
public void SomeMethod()
{
   // does something..
}

Then I want to user to be able to see "This method does such and such" as they type the method.

over 4 years ago · Santiago Trujillo
2 Respostas
Responde à pergunta

0

For .NET Core and recent versions of VisualStudio, checking "XML Documentation file" will add an absolute path, as discussed here. This appears to be a bug, and it's preventing NuGet packages from including documentation.

The solution is to add the following to the .csproj file, and un-check the "XML Documentation file" box.

<PropertyGroup>
  <GenerateDocumentationFile>true</GenerateDocumentationFile>
</PropertyGroup>

A target was recently added to the SDK so that if this value is true, and DocumentationFile is empty (i.e., the checkbox is not set in Visual Studio), it will just "do the right thing" and generate the documentation file in the output folder that NuGet expects.

There is currently no way to do this from the Visual Studio UI; a request to make that change is still being discussed as of the time of this writing.

Update: It looks like the setting for this is now available as a preview feature in Visual Studio.

over 4 years ago · Santiago Trujillo Relatório

0

You have to enable the XML-Documentation when building.

See here

In Project-Properties go to the Build-Tab and select Xml-Documentationfile.

Looks similiar to this

German Version of Visual Studio

over 4 years ago · Santiago Trujillo Relatório
Responde à pergunta
Encontrar trabalhos remotos

Descubra a nova forma de encontrar um emprego!

melhores empregos
Principais categorias de trabalho
Empresas
Postar vaga Preços Comercial
Jurídico
Termos e Condições Política de privacidade
© 2026 PeakU Inc. All Rights Reserved.
Andres GPT
Recomende algumas ofertas para mim
Preciso de ajuda