MVC5 Multiple types were found that match the controller named 'Home'

I had the same issue and found that the older version had created compiled files in the "bin" folder.

Once I deleted these the error disappeared.


I had the problem which occur when 2 dll with the same namespace but different name was in the bin folder just removed the not needed dll and the problem had been fixed.


The error is giving away the answer basically you have multiple controllers named HomeController. I would assume you have not deleted the original IdentitySample.Controllers.HomeController.

You have 2 options.

  1. Delete the IdentitySample.Controllers.HomeController instance.
  2. Change your routes so your routes include the namespace to search (as listed in the error).

If you would like to go with option #2 then in your route table change the default route from

routes.MapRoute(
    "Default", 
    "{controller}/{action}/{id}", 
    new { controller = "Home", action = "Index", id = UrlParameter.Optional },
);

to

routes.MapRoute(
    "Default", 
    "{controller}/{action}/{id}", 
    new { controller = "Home", action = "Index", id = UrlParameter.Optional },
    namespaces: new[] { "RecreationalServicesTicketingSystem.Controllers" }
);

in App_Start\RouteConfig.cs

Where in the second example is telling to look for the controllers in the "RecreationalServicesTicketingSystem.Controllers" namespace.