Scenario: I deployed a MVC 4 site to IIS7 server and when I would nav to the root http://domain.site.com/ it would give a 403 permission error. If I tried to go directly to the controller/action (http://domain.site.com/controller/action), I would get a 404 error.
Trying to load the page on the server, I could see the detail that the it was trying to use the staticFile handler, which is wrong!
I found an article that showed how to set the default controller in the web.config rather than the code, and by doing that I was able to see that the Newtonsoft JSON package was giving an error. This I’ve seen before so I checked my nuget packages, changed them all from net451 to net40, (my project is set to compile as 4.5 not 4.5.1).
I redeployed. Same error. The static handler is still firing rather than .net handler. I added
<modules runAllManagedModulesForAllRequests="true" />
Now it loads normally. Next time I load a new site and do all of this I will try adding that to the web.config first and the see if less needs to be done with updating the nuget packages.