DotnetDude
DotnetDude

Reputation: 11807

MVC application gives an error with routing

I installed a MVC app on one of the machines and it works great. With the same code base, when I install it on a different machine, I get the following error:

A route named "myroute" is already in the route collection. 
Route names must be unique

This makes me want to say something is not correctly installed on the the second machine. Any clues on what may be installed incorrectly?

Upvotes: 2

Views: 1741

Answers (2)

Peter Gfader
Peter Gfader

Reputation: 7741

Check your bin folder. Maybe there is another .dll that adds the same route to the RouteCollection.

This happened to me when I was renaming a project. I had 2 .dlls in my bin folder:

  1. MyProject.Web.dll
  2. MyProjectNewName.Web.dll

Upvotes: 5

RPM1984
RPM1984

Reputation: 73102

This doesn't sound like a installation problem, this sounds like a code problem, most likely with Routes in your Areas conflicting with other routes.

How/when did you get that error? Which URL? Did you request the same URL on both machines?

Do a search in your code-base for "myroute" to be doubly safe.

Upvotes: 1

Related Questions