title: MVC Routing is Trying to Route on Virtual Directory
body: <p>I just started a new C# MVC program. I have a ton of these that work, but this one does not and I cannot quite figure out why.</p>
  
  <pre><code>public static void RegisterRoutes(RouteCollection routes)
  {
      routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
  
      routes.MapRoute(
          name: "Default",
          url: "{action}",
          defaults: new { controller = "Account", action = "LogOn" }
      );
  
  }
  </code></pre>
  
  <p>It gives me this error:</p>
  
  <pre><code>System.Web.HttpException (0x80004005): The controller for path '/VIRTUALDIRECTORY' was not found or does not implement IController.
     at System.Web.Mvc.DefaultControllerFactory.GetControllerInstance(RequestContext requestContext, Type controllerType)
     at System.Web.Mvc.DefaultControllerFactory.CreateController(RequestContext requestContext, String controllerName)
     at System.Web.Mvc.MvcHandler.ProcessRequestInit(HttpContextBase httpContext, IController&amp; controller, IControllerFactory&amp; factory)
     at System.Web.Mvc.MvcHandler.BeginProcessRequest(HttpContextBase httpContext, AsyncCallback callback, Object state)
     at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
     at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&amp; completedSynchronously)
  </code></pre>
  
  <p>Like my other sites, this is setup in a Virtual Directory through Visual Studios. Specifically I have it set to "Don't open a page", "Local IIS", with just a typical URL:  <a href="http://localhost/VIRTUALDIRECTORY" rel="nofollow">http://localhost/VIRTUALDIRECTORY</a></p>
  
  <p>I clicked on Create and it did, there is VIRTUALDIRECTORY in IIS with (what seems at least) to be the same settings as my other virtual directories.</p>
  
  <p>The only difference with this program compared to others is that I am essentially copying a VB.NET MVC program to C#. So I created an empty C# MVC program, then copied and converted the classes. There are (obviously) no compile errors, but I'm sure there's a setting or something that I haven't figured out that's causing this.  </p>
  
  <p>Does anyone else know how to solve this?</p>
  
  <p>I am referencing the latest MVC (5.2.3) via nuget.</p>