.Net 4.0 with MVC 2.0 on IIS 7.5
This one has had me stumped for a while – ASP.NET MVC 2 sites refused to run on IIS 7.5 (Windows 7). It would either complain and break. Or show me the files in the directory. After a bit of Googling around – I found a solution (that works for me at least):
Step 1:
Install the .Net Framework 4 into IIS using:
C:\Windows\Microsoft.NET\Framework\v4.0.30319>aspnet_regiis.exe –i
You will need to run it as Administrator if you have UAC turned on.
Step 2:
Install the correct IIS component’s (Control Panel > Add/Remove Windows features > Internet Information Services > World Wide Web Services)
-
Common HTTP features
- HTTP Errors
- HTTP Redirection
-
Health and Diagnostics
- Request Monitoring
- Tracing
Step 3:
Set the app pool to use ASP.NET 4.0
You show now be able to browse to your sites. Not sure why it doesn’t install into IIS by default though…