Non-XML Web API Help Page

I have a web API project in which I deleted the "Areas" folder a few months ago when we started development. Now that everything is ready, I want to add API help pages, but it does not work properly.

I installed the nuget package for help pages.

I uncommented the line in HelpPageConfig.cs

I checked Create a documentation file (in the App_Data folder)

When I open http: // localhost: 51665 / help I get the following: (No methods are shown)

enter image description here

Any idea what could be wrong? If I start a new project from scratch, everything works correctly.

+7
asp.net-web-api asp.net-mvc-4 asp.net-web-api2 asp.net-web-api-helppages
source share
1 answer

I assume that you set up your project in two stages:

  • You must select the Build tab in the Properties API project and configure the XML documentation file in the Output section. For example: App_Data\XmlDocument.xml
  • Then you can update HelpPageConfig.cs in the Register method ... in my case

config.SetDocumentationProvider(new XmlDocumentationProvider(HttpContext.Current.Server.MapPath("~/App_Data/XmlDocument.xml")));

  • When your project is in the process of compilation, look in the output window to see if documentation is actually being created.
  • Try using the old version of ASP.NET help pages (version 5.2.2 works for me).

    Install-Package Microsoft.AspNet.WebApi.HelpPage -Version 5.2.2

+3
source share

All Articles