Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio Code - .net core - generate xml documentation

We are using Swagger UI documentation to describe our project API. Swagger have to read XML from projectname.xml to show all the C.R.U.D. functions we have in project.

The problem is when I switch from Visual Studio to Visual Studio Code, it is not regenerating or changing existing XML file from Visual Studio Code. Is there the way to generate XML documentation file in Visual Studio Code like in Visual Studio Ultimate for instance, as shown the image below?

visual studio xml documentation file

like image 212
danigitman Avatar asked Nov 28 '16 02:11

danigitman


2 Answers

You can use the <GenerateDocumentationFile> property in the project file. This is a Boolean, and sets the DocumentationFile property automatically.

<PropertyGroup>
  <GenerateDocumentationFile>true</GenerateDocumentationFile>
  <NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>

(Unfortunately, the Visual Studio project properties UI doesn't expose this improved way to enable XML documentation file generation yet. See this work item in the project system repo, and this pull request, which initially added the feature.)

like image 139
Olly Avatar answered Sep 16 '22 14:09

Olly


The following is slightly more robust, it doesn't hard code the framework and project

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
  <DocumentationFile>bin\Debug\$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFile>
  <NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>
like image 33
David Waterworth Avatar answered Sep 19 '22 14:09

David Waterworth