0

After publishing an ASP.NET MVC 2 web application to my schools IIS 7.5 server, I receive a 403 error on initial load and then a 404 error if I try and invoke a route such as /Home/About/Index

I have even tried publishing the default ASP.NET MVC 2 sample application, but with no luck. It appears that the Web Server isn't picking up any of the routes and that it is determining /Home/About/Index to be a directory look-up. Has anyone else experienced similar issues?

I spoke with the system admin and verified that HTTP Redirection and HTTP Errors are enabled. After poking around on, I have seen several comments about routing not working due to the publish location not being a webroot. Any comments on why?

Currently the system admin has the following website directory structure. Could this be the problem?

  • Default Web Sites
    • Fall2010
      • Class123
      • Class321
    • Spring2011

I have sought help from the system admin and my professor, however both are unfamiliar with MVC and routing. Any help is appreciated.

Of course, I can just give up on my idea and just use Web Forms and SOAP much like I have done in my other classes, but I would like to learn more about MVC in ASP.NET and REST. Thanks for the help!

whall
  • 21
  • 4
  • 1
    maybe...http://stackoverflow.com/questions/2374957/asp-net-mvc-on-iis-7-5 – dotjoe Feb 10 '11 at 19:08
  • Thanks, but I already looked at that. I had the system admin try the solution posted there, but it didn't work. I also created a default.aspx page, but it rendered successfully. – whall Feb 10 '11 at 19:25
  • possible duplicate of [Can't run ASP.NET MVC 2 web app on IIS 7.5](http://stackoverflow.com/questions/2659544/cant-run-asp-net-mvc-2-web-app-on-iis-7-5) – bzlm Feb 10 '11 at 20:08

3 Answers3

2

So it looks like the system admin had the app pool to classic mode when it needs to be in integrated. In the default ASP.NET MVC 2 sample application I modified the Global.asax to:

routes.MapRoute(
    "Default",
    "{controller}.aspx/{action}/{id}",
    new { controller = "Home", action = "Index", id = UrlParameter.Optional }
);

And navigated to /Home.aspx/About, everything worked fine.

Now I just need to convince our system admin to change to integrated.

References: http://server.dzone.com/news/routes-iis-classic-and

EDIT: I was able to get the system admin to switch to integrated. Everything appears to be working fine.

whall
  • 21
  • 4
1

If you are using default routes the correct url should be /Home/About. As far as deploying an ASP.NET MVC application on II 7 is concerned you probably want to go through the following blog post.

Darin Dimitrov
  • 1,023,142
  • 271
  • 3,287
  • 2,928
0

Could it be that you need to set up IIS to map wildcards? I know this is for IIS 6 but it may apply to 7 too.

http://www.techdreams.org/microsoft/aspnet/how-to-fix-404-errors-of-aspnet-mvc-website-deployed-on-iis-6-windows-server-2003/2572-20090515