Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC 4 on IIS 7.5, returns 404. Something to do with extensionless route mapping

I have deployed an MVC 4 web-site to a Windows 2008 R2 server with IIS 7.5. .NET 4.5 is installed on the server.

The site works fine locally. All routing works fine. However, when I put it on the server, nothing works. I have confirmed that the DNS/binding is working by putting a static text file in the site and this works.

Here's a few things I've tried:

  • The default route / returns 403.13 - indicating directory browsing is disabled (correct). This should surely map to /home/index?
  • Any route (eg. /Organisation, Organisation/Index) simply returns 404.
  • Made sure all my DLLs are copied over (as per http://haacked.com/archive/2008/11/03/bin-deploy-aspnetmvc.aspx)

I have tried/confirmed:

  • HttpRedirection is installed on IIS7 (as per http://support.microsoft.com/kb/2023146)
  • HttpErrors is installed on IIS7
  • All my DLLs are in place

Am I missing something? My next act of desperation is to install the full ASP.NET MVC 4 stack including Visual Studio Express, SQL Express, etc. just to see if it works. Which I really don't want to do. This is a production server!

Update: I should add that the same site works on en equivalent configuration in-house, on a staging server.

like image 313
Program.X Avatar asked Sep 13 '12 15:09

Program.X


1 Answers

I had this same issue. There's a hotfix you should try: http://support.microsoft.com/kb/980368 It fixed the issue for me.

like image 196
David Hollowell - MSFT Avatar answered Oct 12 '22 14:10

David Hollowell - MSFT