If you want to use Swashbuckle/Swagger to document your ASP.NET Web API application as an alternative to ASP.NET Web API Help, then you can follow these simple steps below:
- Add a NuGet package reference for Swashbuckle to your ASP.NET Web API project
- Click OK to accept the installation of the NuGet package
- You will now see a SwaggerConfig.cs file in your App_Start directory
- You have to enable Xml documentation in the Build properties for your Visual Studio project
- In order to display Xml Comments for your Swagger documentation, you have to uncomment the line for c.IncludeXmlComments(GetXmlCommentsPath());
- Now when you navigate to the /Swagger Url in your ASP.NET Web API application, you should be able to view the Swagger documentation!
No comments:
Post a Comment