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?
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.)
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>
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With