Error after deploying: A route named 'Ajax' is already in the route collection

Oct 28, 2011 at 1:19 PM

Locally my solution works perfectly but after I deploy it to my IIS 7.5 server I get the following error:

A route named 'Ajax' is already in the route collection. Route names must be unique. Parameter name: name

Does anybody encountered this error before?

Regards,

Jeroen van der Wal

Coordinator
Oct 28, 2011 at 1:38 PM

There's a couple of possibilites come to mind

1. Naked Objects adds the route 'Ajax' so if you're adding any routes of your own with the name 'Ajax' it will fail with this error. 

2. If you're not adding any routes of your own I wonder if  RunMVC::RegisterGenericRoutes is being called twice for any reason. The obvious suspect is the change to the startup code now we've gone to using nuget. Is it possible that your startup code is still calling RegisterRoutes in global.asax as well as NakedObjectsStart.cs ? 

Stef

PS I'm not sure the route naming is very good. It should be more specific to avoid naming clashes if at all possible. I'll raise a ticket for this.

 

 

Oct 28, 2011 at 1:58 PM

Removing the RegisterRoutes line in global.asax did the trick!

Thank you for your help!

-Jeroen