asp.net Web APIs generate help documents from annotations
By default, the ASP.net Web API does not generate help documents from controller comments. If you want to use annotations as part of a Web API help document, such as displaying summary in a method annotation in the description column of a Help document, you need to make some configuration actions.
First open the Properties page for the Web API project in Visual Studio, on the Build Settings page, select XML document file, and enter the path to place the XML file that will be generated, such as App_data\openapi.xml.
The project is then compiled, and the XML file is generated under the corresponding path.
Then open the Areas\helppage\app_start\helppageconfig.cs file and cancel config. Setdocumentationprovider code comments, modify the path:
Then recompile, access the/help page, you can see the effect.
Copy Code code as follows:
Config. Setdocumentationprovider (New Xmldocumentationprovider (HttpContext.Current.Server.MapPath) ("~/app_data/ Openapi.xml "))
Through the above simple introduction, I hope to help you