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.)
What I have tried:
<modules runAllManagedModulesForAllRequests="true"/>
- Trying to apply the Microsoft hotfix for extensionless urls (found at http://support.microsoft.com/kb/980368) (Did not help, service pack 1 includes it already)
- Ensuring that HTTP Errors, HTTP Redirection, and Static Content are added to the role services (https://stackoverflow.com/a/4264564/1030925)
- Running the command
aspnet_regiis -iru
- Ensuring the bitness of the application is correct (Any CPU)
- Toggling enabling of 32-bit applications
- Toggling between classic and integrated mode
- Ensuring that 'allow unlisted file name extensions' is checked (https://stackoverflow.com/a/5155322/1030925)
- Ensuring that the ExtensionlessUrlHandler mappings were intact
- Ensuring that my startup code was in Application_Start and not something else
- Ensuring folder permissions to the ApplicationPoolIdentity (it can serve static content)
- Re-adding the
UrlRoutingModule-4.0
module in the web.config (https://stackoverflow.com/a/16577694/1030925)
UPDATE:
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.
Update 3/3/14:
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...