title: MVC routes lost after app pool recycle (updated title 3/3/14)
body: <p>I am trying to deploy an ASP.NET MVC 4 web application to a production server (Windows Server 2008 R2 [x64] with SP1 installed, running IIS 7.5) that already has several other working ASP.NET applications. All I can get is a 403 at index, and a 404 for everything else but the static content. The application works without a problem on my local machine's instance of IIS 7.5 (And I am running on Windows 7, up-to-date, 64-bit.)</p>
  
  <h2>What I have tried:</h2>
  
  <ul>
  <li><code>&lt;modules runAllManagedModulesForAllRequests="true"/&gt;</code></li>
  <li>Trying to apply the Microsoft hotfix for extensionless urls (found at <a href="http://support.microsoft.com/kb/980368" rel="nofollow noreferrer">http://support.microsoft.com/kb/980368</a>) (Did not help, service pack 1 includes it already)</li>
  <li>Ensuring that HTTP Errors, HTTP Redirection, and Static Content are added to the role services (<a href="https://stackoverflow.com/a/4264564/1030925">https://stackoverflow.com/a/4264564/1030925</a>)</li>
  <li>Running the command <code>aspnet_regiis -iru</code></li>
  <li>Ensuring the <strong>bitness</strong> of the application is correct (Any CPU)</li>
  <li>Toggling enabling of 32-bit applications</li>
  <li>Toggling between classic and integrated mode</li>
  <li>Ensuring that 'allow unlisted file name extensions' is checked (<a href="https://stackoverflow.com/a/5155322/1030925">https://stackoverflow.com/a/5155322/1030925</a>)</li>
  <li>Ensuring that the ExtensionlessUrlHandler mappings were intact</li>
  <li>Ensuring that my startup code was in Application_Start and not something else</li>
  <li>Ensuring folder permissions to the ApplicationPoolIdentity (it can serve static content)</li>
  <li>Re-adding the <code>UrlRoutingModule-4.0</code> module in the web.config (<a href="https://stackoverflow.com/a/16577694/1030925">https://stackoverflow.com/a/16577694/1030925</a>)</li>
  </ul>
  
  <h2>UPDATE:</h2>
  
  <p>This morning I stopped the site, stopped the app pool, redeployed without touching anything, and... it works! BUT... if I touch so much as one little thing in the config, whether using FileZilla or the IIS console on the remote desktop, the site blows up and start acting that way again. Only by stopping the site and replacing all the files together have I been able to get it back up -- tried just stopping and replacing the web.config but that did not work. The change can be as simple as disabling and re-enabling my 'redirect to https' rewrite rule.</p>
  
  <h2>Update 3/3/14:</h2>
  
  <p>It seems as though the problem is that my routes stop working when the app pool is recycled, whether by file change or explicit restart. I am registering like two routes in the same way as the project template, using Application_Start and RegisterRoutes. I don't understand why this is not working if it's in the standard project template... </p>