I was having a problem when developing a Web Api 2 project with Owin: help page were not generated as I expected. I followed the tutorial Creating Help Pages for ASP.NET Web API and yet, it was missing something to get it working with OWIN and KATANA.
Searching through the internet I found this answer on StackOverflow: Can’t get ASP.NET Web API 2 Help pages working when using Owin.
The solution is simple:
-
On OWIN Startup.cs or equivalent file, expose
HttpConfigurationand register the help page area withAreaRegistration.RegisterAllAreas():public class Startup { public static HttpConfiguration HttpConfiguration { get; private set; } public void Configuration(IAppBuilder app) { HttpConfiguration = new HttpConfiguration(); AreaRegistration.RegisterAllAreas(); WebApiConfig.Register(HttpConfiguration); app.UseWebApi(HttpConfiguration); } } -
Replace all the
GlobalConfiguration.ConfigurationwithStartup.HttpConfiguration, in my case, only inHelpPageAreaRegistration.RegisterAreaand inHelpControllerconstructor.
