Five New Optimizely Certifications are Here! Validate your expertise and advance your career with our latest certification exams. Click here to find out more

Installation of EPiServer.ServiceApi destroys my site

Vote:
 

Hi, all!

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.

System.InvalidOperationException

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?

#182609
Sep 26, 2017 11:10
Vote:
 

You can try this.  Calling configure twice messes things up.  

#183462
Oct 15, 2017 20:47
* You are NOT allowed to include any hyperlinks in the post because your account hasn't associated to your company. User profile should be updated.