I migrated the site without issue creating a new web application and copying in the required files and configuration. Everything was good and my MVC areas all routed and worked as expected; I had done this before so was confident on the process.
Everything was good until I came to deploy the website on to a Windows 2008 R2 server running IIS7.5 (this configuration is not specific to the resolution I got though!). The website started up ok, I could login ok and access the older forms based pages. I then clicked on to a link that navigated to one of my MVC routes and was presented with a 404...
There are a number of similar issues I found on stackoverflow (http://stackoverflow.com/questions/16178821/mvc-4-application-giving-a-404-when-deployed) that were addressed by adding the following in to the web.config:
To eliminate the IIS being the issue I ran the site on a different server that was running another hybrid site without issue; same problem.<modules runAllManagedModulesForAllRequests="true"/>
After comparing all the settings one I then moved on to the code and after many hours of searching found the culprit.
The application that was working had a published bin with all the regular dll's but the main difference I noticed was it had an App_global.asax reference where the failing app didn't:

For some reason my new application was not outputting these files which meant that MVC routes would not be configured at startup. After playing around with the publish settings, cleaning and rebuilding the solution it started to include the required files. Unfortunately its not an exact answer but will hopefully help some investigating the issue further.
Here is the settings I used in my publish that did eventually work:
Richard
No comments:
Post a Comment