title: MVC 5 Multiple Types Matching Controller
body: <p>I know there are lots of questions and posts about this particular error on Stackoverflow, however, anything I seem to try still does not fix the problem.</p>
  
  <p>I have an <strong>MVC 5</strong> web application which has <strong>two Account Controllers</strong>, one in the default Controller folder, the other in an Area, like so</p>
  
  <ul>
  <li>MyApp.UI.Areas.Admin.Controllers.AccountController</li>
  <li>MyApp.UI.Controllers.AccountController</li>
  </ul>
  
  <p>When I try to hit the Login Action inside PCF360.UI.Controllers.AccountController with this Actionlink</p>
  
  <pre><code>@Html.ActionLink("Log in", "Login", "Account", new { area = "" }, null)
  </code></pre>
  
  <p>I get the following error</p>
  
  <blockquote>
    <p>Multiple types were found that match the controller named 'Account'.
    The request for 'Account' has found the following matching
    controllers: PCF360.UI.Areas.Admin.Controllers.AccountController
    PCF360.UI.Controllers.AccountController</p>
  </blockquote>
  
  <p>Inside Areas --> Admin --> AdminAreaRegistration</p>
  
  <p>I modified the context.MapRoute like so</p>
  
  <pre><code>context.MapRoute(
                  "Admin_default",
                  "Admin/{controller}/{action}/{id}",
                  new { action = "Index", id = UrlParameter.Optional },
                  new[] { "MyApp.UI.Areas.Admin.Controllers" }
              );
  </code></pre>
  
  <p>The MapRoute inside App_Start --> RouteConfig looks like this</p>
  
  <pre><code>routes.MapRoute(
                  name: "Default",
                  url: "{controller}/{action}/{id}",
                  defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional }
              );
  </code></pre>
  
  <p>Does anyone see why I am getting this error?</p>
  
  <p>Thanks for your help.</p>