I'm installing EPiServer.ServiceApi via Nuget, as it is described in the guide, but right after that I get the following error instead of my start page:
An error has occurred.
The object has not yet been initialized. Ensure that HttpConfiguration.EnsureInitialized() is called in the application's startup code after all other initialization code.
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)
I've tried this solution, but config.EnableCors() doesn't exist, config.MapHttpAttributeRoutes() causes error "ArgumentException: A route named 'MS_attributerouteWebApi' is already in the route collection", and all the rest doesn't help. I tried adding "GlobalConfiguration.Configuration.EnsureInitialized();" at the end of initialization, it doesn't help either.
What can be the problem? What causes this error?
You can try this. Calling configure twice messes things up.