Asp.Net MVC Multiple types were found that match the controller named ‘xxxx’

Problem:

I received the following error after I created a new project with a different name NewProject (with the the codes) and deployed to the same web site.

 

Multiple types were found that match the controller named ‘xxxx’. This can happen if the route that services this request (‘{id}’) does not specify namespaces to search for a controller that matches the request. If this is the case, register this route by calling an overload of the ‘MapRoute’ method that takes a ‘namespaces’ parameter.
The request for ‘xxxx’ has found the following matching controllers:
OldProject.WebApp.Controllers.xxxxController
NewProject.WebApp.Controllers.xxxController

 

Note:

If you rename your web app project and deploy, you may get the same error.

Solution:

It occurred because OldProject.WebApp.dll files still exist in the deploy folder “bin”.  Once I delete those old project dll files, no more errors.

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s