I\'ve recently downloaded beta 2 of VS2010 and started playing with ASP.NET MVC2. Initial development was done with Casini, but now I wanted to run the application from IIS
Add this to your web.config
file:
<system.webServer>
<modules runAllManagedModulesForAllRequests="true" />
<!-- rest of config -->
</system.webServer>
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.
What Helped to me is using classic pipeline for AppPool instead of integrated:
I was building an MVC2 application on my laptop Windows 7, using .net beta 2 and VS 2010 beta 2. When I installed the entire development environment on Windows Server 2008, including VS, built the solution and ran it, the routing worked fine.
The next step was to create a production server on Windows Server 2008, on which I deployed the .net 4.0 beta but none of the other stuff which came with the VS 2010 beta download. Under this configuration the routing never worked until I enable HTTP Redirection as indicated by Jeroen.
Hope this helps someone who might be in the same boat.
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.
Just wanted to note that I was having the same problem with 403 and 404s but adding the system.webServer
and all the elements from the system.web/pages/namespaces
node resolved it for me.