title: "The controller for path '...' was not found or does not implement IController." triggers 500 instead of 404
body: <p>This MVC application will throw a HttpException if it cannot find a route.  This is fine, the exception has a 404 status code. However, when customErrors are setup under , for some reason, instead of following the 404 error, MVC treats this exception as a general unhandled exception and follows the 500 status code instead.</p>
  
  <p><strong>Why do custom errors trigger a 500 handling, rather than the desired 404?</strong></p>
  
  <p>The .NET Error Page configuration:</p>
  
  <p><img src="https://i.stack.imgur.com/7eI1N.png" alt="enter image description here"></p>
  
  <p>Stack Trace:</p>
  
  <pre><code>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>