I am using Swashbuckle for Api documentation, which requires projectname.xml document from the output, but when i build my ASP.NET Core project I don't get that file.
https://learn.microsoft.com/en-us/aspnet/core/tutorials/web-api-help-pages-using-swagger
Visual Studio has an option to generate the XML file but how can I do that from console?
Here is my ASP.NET Core version:
.NET Command Line Tools (1.0.0-preview2-1-003177)
For Visual Studio 2017 and the dotnet CLI, setting the DocumentationFile property in the .csproj file will generate XML documentation at the specified path, relative to the project file. For example, to generate the XML doc in the same directory as your built assembly, you can add the following property group to the project file:
<PropertyGroup>
<DocumentationFile>bin\$(Configuration)\$(TargetFramework)\MyProject.xml</DocumentationFile>
</PropertyGroup>
If you only want it built for particular configurations or platforms, make sure to set an appropriate Condition on the property group.
If you are still using Visual Studio 2015, you can do it in the project.json by adding xmlDoc to buildOptions
"buildOptions": {
"xmlDoc": true,
}
Visual Studio 2017 (*.csproj structure) I am not sure. But when you set it via Visual Studio it will be persisted in the csproj/project.json file.
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