What is the best way to get hosting of an MVC.Net application to work on IIS 5 (6 or 7). When I tried to publish my MVC application, all I seem to get is 404 errors. Iv done abit of googleing and have found a couple of solutions, but neither seem super elegant, and I worry if they will be unusable once I come to use a shared hosting environment for the application.
- Right-click your application virtual directory on inetmgr.exe.
- Properties->Virtual Directory Tab-> Configuration.
- Add a new mapping extension. The extension should be .*, which will be mapped to the Executable C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\aspnet_isapi.dll, or the appropriate location on your computer (you can simply copy this from the mapping for .aspx files). On the mapping uncheck "check that file exists".
- 3 X OK and you're good to go.
- If you want, you can apply this setting to all your web sites. In step1, click on the "Default Web Site" node instead of your own virtual directory, and in step 2 go to the "Home Directory" tab. The rest is the same.
Seems a tad hacky to route everything through ASP.NET
Edit the mvc routing to contain .mvc in the url and then follow the steps in solutions 1 based around this extension. Edit: The original image link was lost, but here it is from Google's Cache: