views:

2181

answers:

4

I'm trying to setup the MVC development enviroment on my laptop. I'm running WinXP Pro with IIS 5.1

I got the environment setup with the sample MVC application that come with beta. I can only get to the home page. when i try to open About us page. i run into the page can not be found error. Is it the routing not set in the Global.asax?

+1  A: 

Your issue is that IIS 5/6 don't play nice with routes without extensions, the home page is resolving because its pointing to default.aspx,

In a nutshell, do this:

If *.mvc extension is not registered to the hosting , it will give 404 exception. The working way of hosting MVC apps in that case is to modify global.asax routing caluse in the following way.

 routes.Add(new Route("{controller}.mvc.aspx/{action}", 
       new MvcRouteHandler()) 
       { Defaults = new RouteValueDictionary (new{ controller = "YourController"} ) });

In this way all your controller request will end up in *.mvc.aspx, which is recognized by your hosting. And as the MVC dlls are copied into your local bin , no special setttings need to be done for it.

See this question for lots of good information:

http://stackoverflow.com/questions/57712/mvc-net-and-iis-5

FlySwat
I'm not quite sure that i understand. Does that mean i need to add another route.add and point it to about us?
Jack
+1  A: 

You can give a look at this article that may help you: http://haacked.com/archive/2008/11/26/asp.net-mvc-on-iis-6-walkthrough.aspx

ema
+1  A: 

You may go to your IIS site's properties, tab "Home directory", press "Configuration...", select ".aspx", press "Insert...", Type "c:\windows\microsoft.net\framework\v2.0.50727\aspnet_isapi.dll", uncheck check box and press "Ok". This heplped me.

Veton
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