views:

70

answers:

3

Hey everyone. I am getting 404 errors when I try to access my ASP.NET MVC 2 site. I'm hosting this site using II7, and I have my site set to use the DefaultAppPool Intergrated pipeline mode. Here's my routes, it's a pretty basic site:

        routes.MapRoute(
            "DefaultRoute", // Route name
            "{controller}/{action}/{id}", // URL with parameters
            new { controller = "Home", action = "Index", id = UrlParameter.Optional // Parameter defaults
        });

        routes.MapRoute(
            "UploadRoute", // Route name
            "Upload/{id}", // URL with parameters
            new { controller = "Upload", action = "Index", id = UrlParameter.Optional 
        });

Attemping to go to ~/Home or ~/Upload both result in 404 errors. Browsing to just the root ~/ directory remotely causes the page to just sit and wait forever, if I try to access the root locally I get a 403.14 error. I'm stumped, I thought ASP.NET MVC and IIS7 running integration mode was supposed to be simple. Thanks.

A: 

You might be getting caught up on a non action file like a js or css file. Add an ignore route at the beginning.

routes.IgnoreRoute("*.html|js|css|gif|jpg|jpeg|png|swf");

You can also try using the RouteDebugger and see where it is going, or not in your case http://haacked.com/archive/2008/03/13/url-routing-debugger.aspx

A: 

Also, check to see that HTTP Redirection is enabled in IIS7.

Rob Rodi
A: 

First thing: The most specific routes should be at the top of declaration. Your default route should be the last to be created or all following routes will be ignored.

Back to topic: Does your DefaultAppPool runs under .NET 4.0? Maybe this link can help you? Looks more like a configuration issue of your IIS?

Olaf Watteroth