The page you are requesting cannot be served because of the extension configuration

Technorati Tags: IIS 7.0,WCF,Service Model,ServiceModelReg

Recently, I migrated to Windows 7 and ended up installing all my software's again. I had a project which involved hosting a WCF service on IIS. The service used a .svc file extension and IIS 7 on my machine was not aware how to handle these files.

The error I got looked something like this:

HTTP Error 404.3 – Not Found

The page you are requesting cannot be served because of the extension configuration. If the page is a script, add a handler. If the file should be downloaded, add a MIME map. Detailed Error InformationModule StaticFileModule.

There were more errors related to local machine below these errors.I looked up the net and after some digging figured out the solution to the problem:

  1. Run Visual Studio 2008 Command Prompt as “Administrator”.
  2. Navigate to C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation.
  3. Run this command servicemodelreg –i.

The servicemodelreg is a command line tool which provides the ability to manage the registration on ServiceModel on a machine. You can get more info on the tool at MSDN here.

I guess the mistake I made was enabling IIS post installing VS and .NET 3.5 or else the services are not turned on for IIS 7.0 by default.