Visual Studio -.net core code - generate XML documentation

We use documentation Swagger UIto describe our project API. Swagger must read the XML from projectname.xmlto show all the CRUD functions that we have in the project.

The problem is that I am switching from Visual Studio to Visual Studio Code, this is not regenerating or modifying an existing XML file from Visual Studio code. Is there a way to create an XML documentation file in Visual Studio Code, for example in Visual Studio Ultimate, as shown in the image below?

visual studio xml documentation file

+4
source share
2 answers

In the csproj file for the project, add the following.

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
 <DocumentationFile>bin\Debug\netcoreapp2.0\TodoApi.xml</DocumentationFile>
</PropertyGroup>

Then rebuild your project.

+2

,

<PropertyGroup Condition="'$(Configuration)|$(Platform)'=='Debug|AnyCPU'">
  <DocumentationFile>bin\Debug\$(TargetFramework)\$(MSBuildProjectName).xml</DocumentationFile>
  <NoWarn>1701;1702;1705;1591</NoWarn>
</PropertyGroup>
0

Source: https://habr.com/ru/post/1662099/


All Articles