ASP.NET Web API Help Page documentation using Xml comments on controllers
The XmlDocumentationProvider is looking for the xml file(having your xml code comments) which gets generated when you compile your project. You can enable generating this by going to your project Properties -> Build -> Output. Here select the checkbox for XML Documentation file.
If you still problem then see below steps.
Step 1 - Add comment on the controller level
// GET api/documentation
/// <summary>
/// This is how we create a documentation
/// </summary>
/// <returns></returns>
public IEnumerable<string> Get()
Step 2 - Build Property Project Properties page and set up the xml output for documentation
Step 3 - HelpPage Config
To set up the HelpPageConfig to use our documentation xml file, go to ~\Areas\HelpPage\HelpPageConfig.cs
.
By default, the config.SetDocumentationProvider statement is commented out. Use that statement, and point the location of DocumentationProvider to our xml file:
public static void Register(HttpConfiguration config)
{
// Uncomment the following to use the documentation from XML documentation file.
config.SetDocumentationProvider(
new XmlDocumentationProvider(
HttpContext.Current.Server.MapPath("~/App_Data/Documentation.xml")));
}
EDIT:
The location of the HelpPageConfig in a new Web API 2.2 project created in VS2013 is ~\Areas\HelpPage\App_Start\HelpPageConfig.cs
I know that this question is answered, but in case it helps someone I have found this page because of looking for solution for documentation for IHttpActionResult
How to add IHttpActionResult into documentation