Recently I joined a new website hosting provider who supported WebMatrix and MVC. After I used Web Deploy to upload my working files to the server, I got 404 errors on some of the pages. After some investigation I realized that I had to specify the full cshtml file extension on all links. After doing some research, Rick Strahl once again saved my life. In his blog entry, he explained that the following line of code must be added to web.config, if hosted on IIS 7, for routing to work.

<modules runAllManagedModulesForAllRequests="true">

Who would have thought of that?

Advertisements