Hosting a WCF Service in IIS 7.0

If you would like to deploy your WCF Service within following environment:

  1. Windows Server 2008
  2. IIS 7.0

Or facing following Error:

Server Error in Application “DEFAULT WEB SITE/ EmployeeService “Internet Information Services 7.0

Error Summary

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

Notification ExecuteRequestHandler

Handler StaticFile

Error Code 0×80070032

Requested URL http://localhost:80/EmployeeService/ EmployeeService.svc

Physical Path

C:\inetpub\wwwroot\Employee.Net.Services\/EmployeeService \EmployeeService.svc

Logon Method Anonymous

Logon User Anonymous

Most likely causes:

It is possible that a handler mapping is missing. By default, the static file handler processes all content.

The feature you are trying to use may not be installed.

The appropriate MIME map is not enabled for the Web site or application. (Warning: Do not create a MIME map for content that users should not download, such as .ASPX pages or .config files.)

If ASP.NET is not installed.

Things you can try:

In system.webServer/handlers:

Ensure that the expected handler for the current page is mapped.

Pay extra attention to preconditions (for example, runtimeVersion, pipelineMode, bitness) and compare them to the settings for your application pool.

Pay extra attention to typographical errors in the expected handler line.

Please verify that the feature you are trying to use is installed.

Verify that the MIME map is enabled or add the MIME map for the Web site using the command-line tool appcmd.exe.

To set a MIME type, use the following syntax: %SystemRoot%\windows\system32\inetsrv\appcmd set config /section:staticContent /+[fileExtension='string',mimeType='string']

The variable fileExtension string is the file name extension and the variable mimeType string is the file type description.

For example, to add a MIME map for a file which has the extension “.xyz”: appcmd set config /section:staticContent /+[fileExtension='.xyz',mimeType='text/plain']

Warning: Ensure that this MIME mapping is needed for your Web server before adding it to the list. Configuration files such as .CONFIG or dynamic scripting pages such as .ASP or .ASPX, should not be downloaded directly and should always be processed through a handler. Other files such as database files or those used to store configuration, like .XML or .MDF, are sometimes used to store configuration information. Determine if clients can download these file types before enabling them.

Install ASP.NET.

Create a tracing rule to track failed requests for this HTTP status code. For more information about creating a tracing rule for failed requests, click here.

And looking some work around for it then this article for you…..go ahead…

For deploying WCF you need to do one way from the following one:

  1. You have to run servicemodelreg -i as an administrator using VS 2008 Command prompt (you can find it in <WINDOWSDRIVE>:\Windows\WinFx\v3.0\Windows Communication Foundation).

Credit goes to:

2. If you want to do it from scratch…just follow this article:;_Windows_2008_-_The_right_way.aspx

That’s it…

Let me know if you face some problem…may be i can help..


About these ads

Tags: ,

About kiranpatils

As a passionate programmer I am enjoying in this field for more than 6 years, currently leading a development team. This team is responsible for keeping high up-time and low response time of application, debugging critical performance related issues, analyzing live issue as a high priority, application version upgrade and above all developing new features on top of Sitecore. Many a times I get involved in client conversations as well for new requirement or wherever some technical or functional guidance is required. Other than that, I do enjoy working in a team and building the overall strength of team by effective knowledge sharing and guidance. Spending free time with family and friends, listening music, reading books, traveling and exploring the nature, keeps me recharged! Recognized as a Microsoft Certified Technology Specialist - Web and Windows, and a Microsoft Certified Professional Developer - Web. Enjoys helping others for solving technical issues. Writes regular posts at : and

7 responses to “Hosting a WCF Service in IIS 7.0”

  1. Sen says :

    Worked like a charm !! Thanks a lot…

  2. Mark B says :

    Yep – thanks!

  3. santhosh says :

    this website fixed my problem. Working like charm

  4. Leonid Ganeline says :

    Fixed my issue too.
    Before that the URL in browser just shown the content of the .svc file as a plain text:
    <%@ ServiceHost Language="C#" Debug="true" Service=…

    Thanks a lot!!!

  5. country music promotion companies says :

    Hi there, just became alert to your blog through Google, and found that it’s
    truly informative. I am going to watch out for brussels.

    I’ll appreciate if you continue this in future. A lot of people will be benefited from
    your writing. Cheers!

Trackbacks / Pingbacks

  1. 2010 in review « A Place for C Sharpers/.Netters - January 3, 2011
  2. joothost - February 7, 2012

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s


Get every new post delivered to your Inbox.

Join 250 other followers

%d bloggers like this: