Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ASP.NET MVC on IIS falls through to the static file handler

Tags:

I have a problem with an ASP.NET MVC site.

These are the details:

  1. ASP.NET MVC 2
  2. ASP.NET 4 integrated pipeline
  3. IIS 7.5 on Windows Web Server 2008 R2

Whenever I make a request for the app I get the "HTTP Error 404.0 - Not Found"-error and the detailed error information shows it is the static file handler that reports the error:

  • Module: IIS Web Core
  • Notification: MapRequestHandler
  • Handler: StaticFile
  • Error Code: 0x80070002

meaning that the request never entered the MVC stack.

I should note that the IIS already serves a ASP.NET MVC 3 on the same app pool and a MVC 2 on a ASP.ENT 2 app pool. So it's the combo ASP.NET 2 on the ASP.NET 4 app pool that are giving me headaches.

Basically I want to upgrade the app from ASP.NET MVC 2 on a ASP.NET 2.0 app pool to a ASP.NET MVC 2 on a ASP.NET 4.0 app pool.

So any ideas?

like image 424
Jacob Rohde Avatar asked Aug 04 '11 12:08

Jacob Rohde


1 Answers

I see you fixed your issue, but for anyone googling:

I had this issue and in my case I just needed to register ASP.NET 4 with IIS. I was deleting and re-adding webs to fix other issues and simply forgot to do that. The command that worked for me was:

C:\Windows\Microsoft.NET\Framework64\v4.0.30319>aspnet_regiis -i

Your own .net version may be different, especially if you are in the future, so the above path may not be exactly right.

like image 78
Chris Avatar answered Sep 27 '22 20:09

Chris