views:

166

answers:

4

I have what seems to be a strange problem to me. I am working on creating an ASP.NET MVC project and when I load the site using the 'Visual Studio Development Server', everything works as expected. However, if I change the project properties to 'use local IIS Web Server' and load the site, only the Home Page works. If I try to load any other page I get a 404 error. The application is running on Windows Server 2003 and IIS 6.

Any suggestions on how to fix this issue would be greatly appreciated.

A: 

Sounds like you haven't configured wildcard mapping (the best option if you have access to the IIS server). Here's a good guide for you to follow.

RichardOD
+4  A: 

Not strange at all. You need to setup IIS6 to route requests to the ASP.NET engine.

Steve Sanderson has a fine article discussing different options on deploying ASP.NET MVC to IIS 6.

He presents five alternative solutions - pick one:

  1. Use a wildcard mapping for aspnet_isapi.dll
  2. Put .aspx in all your route entries’ URL patterns
  3. Use a custom filename extension in all your URL patterns
  4. Use URL rewriting
  5. Upgrade to Windows Server 2008 and IIS 7
Jørn Schou-Rode
This fixed it. I figured it was something simple link this.
Hamman359
+2  A: 

IIS6 need to be setup for working with MVC:

You sould map . to "c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll"

ASP.NET MVC on IIS 6 Walkthrough

CD
A: 

Url rewriting can help you to solve the problem. I've implemented solution allowing to deploy MVC application at any IIS version even when virtual hosting is used. http://www.codeproject.com/KB/aspnet/iis-aspnet-url-rewriting.aspx

Alex Ilyin