Getting an ASP.MVC2/VS2010 application to work in IIS 7.5

Add this to your web.config file:

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

After more checking and trying I noticed in the "Turn Windows features on or off" dialog that "HTTP Errors" and "HTTP Redirection" were missing. This is strange because as far as I can remember this was installed automatically by the Microsoft Web Platform Installer. In any case "HTTP Redirection" seemed like a need-to-have feature when working with MVC. So after I installed it everything seemed to work perfectly.


It is such a pain doing this manually. But definitely doable! I managed it and summed it up in this step by step guide on adding an mvc 2 project to an exisitng web forms solution here. Hope this helps... it took me ages to work though all the config settings and there seem to be so few resources on the subject.


I've just had this problem, and unfortunately the fix here didn't work for me.

What did work was running this:

%windir%\Microsoft.NET\Framework64\v4.0.30319\aspnet_regiis.exe -ir

in a command window...works like a dream now!

(So, is ASP.Net not installed into IIS by default when you install VS2010?)