Note the point:
The 1.MVC controller must inherit from the Apicontroller, otherwise it will not be visible.
2. Simple view of XML, according to the second step to generate XML, visual sense is relatively low, but the content is all, not limited to the API
The following is the reproduced text
========================================================================================
After you create a new Web API project, you will see the API help document on the homepage with the API's navigation menu, but unfortunately, Description is not content.
What do we do?
The first step:
If you use VS2013 to create a new project (VS2012 did not try), the project will have areas/helppage such a directory, you read it wrong, the document is the goods generated.
What if you delete or do not have this directory? It doesn't matter, you just need to use NuGet to add "Microsoft.AspNet.WebApi.HelpPage" this goods, and then you find that your project automatically added areas/helppage this lump
Step Two:
Select items, right-click, properties, generate, select the following XML document file, and fill out the directory yourself, such as:
Step Three:
Locate the HelpPageConfig.cs file under the Areas/helppage/app_start directory, Register method, and add a line of code:
1 config. Setdocumentationprovider (New Xmldocumentationprovider (HttpContext.Current.Server.MapPath ("~/areas/helppage/ Webapihelp.xml ")));
Then build, start the project, click on the API to see
Then you will feel that you are awesome ...
Ps: The premise of generating API documentation is that you write comments!!!!!
From
http://blog.csdn.net/shiyaru1314/article/details/49995547
Related articles recommended
Http://www.cnblogs.com/pmars/p/3673654.html
MVC Webapi Auto-Generate help document (GO)