title: MVC4 Area returning 404 only on IIS and not everytime
body: <p>So I built a new ASP.NET MVC4 application, some really simple stuff. I added an Area for administration purposes. Everything works fine when I debug on Visual Studio's IIS Express. </p>
  
  <p>The problem comes when I deploy this application on a Windows Server 2012's IIS, most of the time, when I try to acces my Area I get a 404 error. The weired thing is sometimes, after redeploying the application (but not changing anything), the area will work for a certain amount of time (until the application pool gets recycled maybe ?)</p>
  
  <p>Anyway this is really weired and I'd need a hand on this. Here's what I've done :</p>
  
  <p>Here is my <code>RouteConfig</code> for the base application :</p>
  
  <pre><code>public class RouteConfig
  {
      public static void RegisterRoutes(RouteCollection routes)
      {
  
          routes.IgnoreRoute("{resource}.axd/{*pathInfo}");
          routes.MapRoute(
              name: "NewsFilter",
              url: "Articles/{tagName}",
              defaults: new { controller = "Home", action = "Index", tagName = UrlParameter.Optional },
              namespaces: new[] { "myapp.Controllers" }
          );
  
          routes.MapRoute(
              "ViewArticle",
              "Article/{articleId}/{articleTitle}",
              new { controller = "Article", action = "Index", articleTitle = UrlParameter.Optional },
              new { articleId = @"\d+" },
              namespaces: new[] { "myapp.Controllers" }
          );
  
  
          routes.MapRoute(
              name: "Default",
              url: "{controller}/{action}/{id}",
              defaults: new { controller = "Home", action = "Index", id = UrlParameter.Optional },
              namespaces: new[] { "myapp.Controllers" }
          );
      }
  }
  </code></pre>
  
  <p>Now here's my <code>AdminAreaRegistration</code> for the Admin area</p>
  
  <pre><code>public class AdminAreaRegistration : AreaRegistration
  {
      public override string AreaName
      {
          get
          {
              return "Admin";
          }
      }
  
      public override void RegisterArea(AreaRegistrationContext context)
      {
          context.MapRoute(
              name: "Admin_default",
              url: "Admin/Home/{action}/{id}",
              defaults: new { controller="Home", action = "Index", id = UrlParameter.Optional },
              namespaces: new []{ "myapp.Areas.Admin.Controllers" }
          );
          context.MapRoute(
              name: "Admin_news",
              url: "Admin/News/{action}/{id}",
              defaults: new { controller="News", action = "Index", id = UrlParameter.Optional },
              namespaces: new[] { "myapp.Areas.Admin.Controllers" }
          );
          context.MapRoute(
              name: "Admin_Tags",
              url: "Admin/Tags/{action}/{id}",
              defaults: new { controller = "Tags", action = "Index", id = UrlParameter.Optional },
              namespaces: new[] { "myapp.Areas.Admin.Controllers" }
          );
      }
  }
  </code></pre>
  
  <p>Now here id the <code>Application_Start</code> method from <code>Global.asax</code></p>
  
  <pre><code>    protected void Application_Start()
      {
          AreaRegistration.RegisterAllAreas(); //This registers the admin Area
  
          WebApiConfig.Register(GlobalConfiguration.Configuration); //I did not delete WebApiConfig even though I'm not using it
          FilterConfig.RegisterGlobalFilters(GlobalFilters.Filters);
          RouteConfig.RegisterRoutes(RouteTable.Routes); //And here are my "normal" routes
          BundleConfig.RegisterBundles(BundleTable.Bundles);
  
      }
  </code></pre>
  
  <p>All the controllers from my Admin area are in the namespace <code>myapp.Areas.Admin.Controllers</code>. The main app controllers are in the namespace <code>myapp.Controllers</code>.</p>
  
  <p>On IIS, the app pool for the application is running in .net 4.0 Integrated mode.</p>
  
  <p>Any idea why the area is working in debug mode, working <em>sometimes</em> on IIS and returning 404 <em>most of the time</em> ?</p>