IIS 7.5 returning a 404 for one MVC route, but only when deployed

asp.net-mvchttp-status-code-404iis-7.5

I have a site that is working fine on my local dev machine. When I run everything in IIS Express, the site is working fine. However, when i deploy my app to production, everything but one route is working. That one MVC route is returning a 404 error.

I turned on Failed Request Tracing and have the trace file. All i can see in it is that there is a warning on the "Module Set Response Error Status" and it says it came from the ManagedPipelineHandler.

There's nothing I can find unique about this route. Everything I can find says it should work, but for some reason it doesn't.

The Failed Request Tracing reads like a set of stereo instructions. I'm not sure what I should be looking for.

Best Answer

1) Try adding following code in your web.config file:

<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!-- rest of config -->
</system.webServer>

2) Make sure that your application is running under ASP.Net 4.0 integrated pipeline mode. If not, set this application pool to integrated pipeline mode and recycle it once.