Try our conversational search powered by Generative AI!

Episerver find DefaultApi is already in the route collection


I have just installed episerver find into my project. When I try to run the project, I am getting an error:

'A route named 'DefaultApi' is already in the route collection'.

I could only see one instance of 'Default Api' in my entire solution and it is WebApiConfig. There is no other place with 'DefaultApi'.

Jun 13, 2016 11:03

Sounds like a name clash. Possible to rename route for webapi?

You can probably remove it altogether if you have Episerver Find installed as well. 

Episerver Find sets some default routing for webapi in the class EPiServer.Find.UI.WebApiConfig. 

HttpRouteCollectionExtensions.MapHttpRoute(config.Routes, "DefaultApi", basePath + "/{controller}/{id}", (object) new
        id = RouteParameter.Optional

These will collide with your web api rename or remove your web api route should solve the issue

Hope that helps... :)

Edited, Jun 13, 2016 11:48
* 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.