HTTP Error 404.0 - Not Found (MapRequestHandler / StaticFile) when deploying WCF Web API on IIS 7.x

Written on December 11, 2011

If you're deploying a WCF Web API application to your IIS 7.x you might receive a HTTP Error 404.0 (MapRequestHandler / StaticFile):

404

As you know, WCF Web API relies on .NET Framework 4.0.

So lets take a look into the application pool for our application:

.NET Framework 4.0 selected

Everything looks fine here.

So lets dig a little bit deeper -- namely inspect the ISAPI Filters:

IIS Manager / choose ISAPI Filters

IIS Manager / ISAPI Filters ... ASP.NET 4. is missing

Looks like ASP.NET 4 is missing here... so lets fix it:

PS C:\Windows\Microsoft.NET\Framework64\v4.0.30319> .\aspnet_regiis.exe -i
Start installing ASP.NET (4.0.30319).
........
Finished installing ASP.NET (4.0.30319).

Now hit F5 in your browser:

yay!

(If it's not working after installing ASP.NET 4.0.x please review the version in your application pools settings again and fix it if necessary).