Posted on 14/10/2015 16:05:18
Hi folks,
I've been trying things out with WebAPI on DW and run into a problem where by I see this error message when navigating to a page:
<Error><Message>An error has occurred.</Message><ExceptionMessage>The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code.</ExceptionMessage><ExceptionType>System.InvalidOperationException</ExceptionType><StackTrace> at System.Web.Http.Routing.RouteCollectionRoute.get_SubRoutes()
at System.Web.Http.Routing.RouteCollectionRoute.GetRouteData(String virtualPathRoot, HttpRequestMessage request)
at System.Web.Http.WebHost.Routing.HttpWebRoute.GetRouteData(HttpContextBase httpContext)</StackTrace></Error>
This happens when I follow Klavs demo and add a WebAPI route. The WebAPI part is working as expected but once I add the route if I navigate to a content managed page using the the friendly name in the URL I see the above error. If I navigate to the page using the page id eg http://localhost/default.aspx?id=1 then the page is displayed properly. If i comment out the WebAPI route the friendly name works again.
I've taken the solution files that Klavs included in the thread and it happens in that too. What am I missing?
I'm using DW 8.6.1.16
Cheers,
Alec