Deploying ASP.NET MVC 3 to IIS 6
I recently built a new ASP.NET MVC 3 (.NET 4) web application which unfortunately has be hosted on Windows Server 2003 running IIS 6. Guess I’d figured getting it running on IIS 6 would be as easy as installing .NET 4 and ASP.NET MVC 3 on the server… but it wasn’t. This isn’t a step by step tutorial on how to get this working, but more of a list of things to look out for and some links to helpful material which all helped getting my site up and running.
Installations
- Install the .NET 4 Framework.
- Install ASP.NET MVC 3. Apparently you can avoid installing ASP.NET MVC 3 on the server and just deploy all the appropriate MVC assemblies in the bin folder of your app instead, but I couldn’t get this to work.
IIS Configuration
- Make sure ASP.NET v4.0.30319 is ‘Allowed’ under Web Service Extensions in IIS – it is ‘Prohibited’ by default.
- Create a new app pool for your web site to use – IIS 6 app pools cannot run sites under different frameworks so make sure this app pool is only used for your new site.
IIS Website Configuration
Right click on your new website and select ‘Properties’:- Under the ‘ASP.NET’ tab, make sure that the ASP.NET version is set to ‘4.0.30319’.
- Under the ‘Home Directory’ tab, make sure that ‘Execute permissions’ is set to ‘Scripts only’ (at least).
- Click on the ‘Configuration’ button in the ‘Home Directory’ tab and make sure that all the Application extensions are mapped to .NET 4 versions of the dlls.
- Add a ‘Wildcard application mapping’ – click on ‘Insert’ and enter ‘C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll’ as the ‘Executable’. Leave ‘Verify that file exists’ unchecked – checking this made my routes stop working.
Permissions
If you’re running under an account with limited permissions, you may need to grant it ‘List Folder Contents’ and ‘Read’ permissions on the Windows Temp directory. I needed to do this because I’m calling out to web services and .NET creates temporary classes in the Windows Temp directory with which to serialize objects from XML. Not sure if this is needed if you’re not doing any serializations, but worth mentioning.
Conclusion
I kept getting 403 and 404 errors when I first deployed my new ASP.NET MVC 3 (.NET 4) web application to IIS 6, but after doing / checking all of the above, it all seems to be working smoothly.
And last but not least: if you’re allowed to, try recycling your application pool and resetting IIS if some changes don’t seem to be making much difference.
Useful links
http://haacked.com/archive/2010/12/22/asp-net-mvc-3-extensionless-urls-on-iis-6.aspx
http://johan.driessen.se/posts/getting-an-asp.net-4-application-to-work-on-iis6
http://blog.stevensanderson.com/2008/07/04/options-for-deploying-aspnet-mvc-to-iis-6/






















Your post on deploying MVC3 to IIS6 really helped me. Thanks for having it so well written.
@David Shaw: You’re very welcome – glad it helped! :)
I was encountering the 403 404 error on IIS 6 after installation. Good thing I chanced upon your site!
@Sherwin C: Really glad it helped :)
I am new to web application develoment and needed to deploy mvc 3 app on iis 6 and got problem. Luckily I found this post. Thanks.
Hi, thx a lot for your post.
The ‘Verify that file exists’ unchecked was my personal issue.
@Julius: Glad you figured it out :)
Thanks for the quick rundown and checklist!
Br. M
@MLJC: No worries!
Thanks Annie. This article saved my day at work today. Even after installing MVC3, and following all steps you had listed in this article. I was receiving HTTP 500 error instead of a HTTP 403 or HTTP 404. I had no issues with UAT environment, but the problem was with our PROD; looks like it was locked down for more things. There wasn’t any reliable source for fixing this issue except yours, which is detailed and well written.
The one thing that is missing in this article is I had to add *.asax mapping to ‘C:\WINDOWS\Microsoft.NET\Framework\v4.0.30319\aspnet_isapi.dll’, even though ‘Wildcard application mapping’ was entered.
Thanks again.
Great Post! Everything is very nicely laid out & summarized. Wish I had found this yesterday morning :).
Also, for anyone struggling with deploying assemblies to the bin folder rather than installing MVC, this article was very helpful: http://haacked.com/archive/2011/05/25/bin-deploying-asp-net-mvc-3.aspx.
Brilliant! I’d done almost all these steps, but your list got it working!
Thanks