2

I'm trying to change a webapi project to use OWIN, based in part on this article:

http://www.asp.net/web-api/overview/hosting-aspnet-web-api/use-owin-to-self-host-web-api

However this appears to involve changing my RouteConfig.RegisterRoutes method from using a System.Web.Routing.RouteCollection to a System.Web.Http.HttpRouteCollection. How would I do the following with the HttpRouteCollection?

public static void RegisterRoutes(HttpRouteCollection routes)
        {
            routes.IgnoreRoute("elmah.axd");  // No IgnoreRoute extension for HttpRouteCollection?

Or am I approaching this all wrong?

The main driver for this is I am using signalR in the project, but because it seems to automatically use OWIN I've ended up with a mix of configuration in Global.asax (for webapi stuff) and OwinStartup class (for signalR) and I'm prefer to do it all in one place.

mutex
  • 7,536
  • 8
  • 45
  • 66
  • Web API currently does not have an extension like `IgnoreRoute`. Also, as far as I remember ELMAH doesn't have support for Selfhost yet, so you cannot use it there. I would not recommend shifting from WebHost to Selfhost scenario just for the sole reason of configuration as the two hosts have some differences. – Kiran Nov 11 '13 at 14:07
  • Ah I'm not actually going so far as to Self Host, just moving all my configuration into the Owin Startup class. – mutex Nov 11 '13 at 20:40

0 Answers0