Trying to figure out how to deploy an MVC app to IIS 6 (MVC 2,3, or 4) can be quite a nuisance. If you Google it you’re bound to end up with a lot of suggestions that don’t actually work.
One trick is to change the Global.asax when delpoying to an IIS 6 box, which was mostly used in MVC 2 apps, but I think that setting up wildcard applications maps in IIS may be easier and the added benefit is that extensionless routing for MVC 2 will also work.
I followed the steps below (which I found here) and it worked like a charm.
- go to my server, click start > run, and type in inetmgr. Hit Ok.
- find your application on the left.
- right click the application, click properties
- in the Directory tab, hit Create (under Application Settings)
- click the Configuration… button right below that
- double click the .asax extension, copy the path to that DLL (aspnet_isapi.dll)
- hit cancel
- under wildcard application maps, click the insert button
- paste the path (aspnet_isapi.dll) into the Executable textbox
- UNCHECK the “Verify that file exists” checkbox.
- Click the ASP.NET tab, make sure you have running version 4.0
- If you aren’t, change it.
One other thing to remember is to install the MVC 3 Runtime on whatever server we’re deploying to or you’ll get one of the following errors:
(The installer can be found here.)