Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

MVC Views returning 404 in IIS 7.5

I've been trying to figure out why my views are returning 404 in my staging environment, but not my development environment.

  • Windows Server 2008 R2
  • IIS 7.5
  • MVC 2 Beta definitely installed.

The first Route entry in my Global.asax is as follows:

        routes.MapRoute(
            "FindStore",
            "FindStore",
            new { controller = "FindStore", action = "Index" });

All views are definitely present and in the proper directories.

Basically if I go to http://StagingServer/FindStore I get a 404 error. Every other answer I've seen has to do with IIS 6. which I'm not running.

like image 248
Ben Lesh Avatar asked Jan 14 '10 16:01

Ben Lesh


4 Answers

We had a similar problem. We checked integrated mode, permissions, and runAllManagedModulesForAllRequests. No dice. Eventually this windows hotfix fixed it.

like image 149
James McCormack Avatar answered Nov 16 '22 02:11

James McCormack


It ended up being because my App Pool was running in Classic mode.

like image 27
Ben Lesh Avatar answered Nov 16 '22 02:11

Ben Lesh


I am not sure if this will help but there was an issue reported on Stack Overflow that uses both technologies and involves a similar problem: Getting an ASP.MVC2/VS2010 application to work in IIS 7.5

I would check it out and see if it helps.

like image 1
Alos Avatar answered Nov 16 '22 04:11

Alos


I had the same problem, my App Pool was set to Classic and I had changed it to use the .NET 4.0 Framework, but it didn't start working until I recycled the App Pool.

like image 1
Craig Howard Avatar answered Nov 16 '22 03:11

Craig Howard