title: Custom ControllerFactory does not replace DefaultControllerFactory when there is a controller collision
body: <p>I have a custom controller factory (very basic implementation that is relevant to my question):</p>
  
  <pre><code>public class MyControllerFactory : DefaultControllerFactory
  {
      public override IController CreateController(RequestContext requestContext, string controllerName)
      {    
          var controller = base.CreateController(requestContext, controllerName);
  
          return controller;
      }
  
      protected override System.Web.SessionState.SessionStateBehavior GetControllerSessionBehavior(RequestContext requestContext, Type controllerType)
      {
          return base.GetControllerSessionBehavior(requestContext, controllerType);
      }
  }
  </code></pre>
  
  <p>Which is registered in <code>global.asax</code> like this:</p>
  
  <pre><code>protected void Application_Start()
  {
      ControllerBuilder.Current.SetControllerFactory(typeof(MyControllerFactory));
  
      // other code here
  }
  </code></pre>
  
  <p>Breakpoints set in this controller factory are hit properly when there is no conflict in resolving the controller (e.g. only one controller is found in the resolution process).  However, when I have two controllers with the same name (in my case: one in an area, one not in an area) without using the namespaces constraint in the route, my controller isn't hit, and the <code>DefaultControllerFactory</code> takes over and throws an (expected) exception.</p>
  
  <hr>
  
  <p><strong>My Questions</strong></p>
  
  <p>Am I registering <code>MyControllerFactory</code> properly?  Is there some other reason that it's not getting used in the case I've outlined above?</p>
  
  <hr>
  
  <p><strong>What I'm trying to do</strong></p>
  
  <p>I'm trying to write a <code>ControllerFactory</code> that automatically uses controllers that are defined in a (config-specified) area (i.e. if a conflict occurs, like above, use the area controller instead of the non-area controller).  If the area doesn't contain a matching controller, fall back to the one that is not in an area.</p>