Gáspár Nagy on software

coach, trainer and bdd addict, creator of SpecFlow

Enable WCF hosing in IIS 7

by Gáspár on January 18, 2009

Update: there is an updated version of this post: Enable .NET 4.0 WCF hosing in IIS 8

As I was playing with WCF services on Windows 7, I had to set up IIS to host a WCF service. It turned out that it is not as straightforward as I expected. Here is a small summary about the steps that you have to do. (I have found a post of Pandurang Nayak that describes these steps, but that article is not available currently, only through Live Search cache).

  1. Don’t forget to install IIS… :) Yes, it took me some time to realize that it is not installed by default.
  2. When you install IIS (Contol Panel / Programs / Turn Windows features on or off), the sub-components selected by default are not enough. You need at least the Windows authentication, the IIS 6 Management Compatibility (for Visual Studio) and probably some more, but I gave up playing with the sub-components and finally selected all.
    Don’t forget to restart your machine. Although you are not asked to do that, for me it did not work.
  3. Still in the “Turn Windows features on or off” dialog, you have to enable sub components of .NET 3.5: WCF HTTP and Non-HTTP Activation. (Did you know that you can do such things here?)
  4. As I have installed IIS after installing Visual Studio 2008, I had to register the ASP.NET components for IIS by executing C:\Windows\Microsoft.NET\Framework\v2.0.50727\aspnet_regiis.exe –i
  5. Finally you have to register WCF as well for IIS (to understand the .svc extension for example). You can do it by executing C:\Windows\Microsoft.NET\Framework\v3.0\Windows Communication Foundation\ServiceModelReg.exe –i

If you have followed these steps (plus maybe a few more restart) you will be able to host WCF services on IIS 7.

Visual Studio 2008 can help you to configure and debug the virtual directory for you, but for this feature you have to run Visual Studio as administrator.


But fortunately there is an informative error message if you forget to do so.


3 thoughts on “Enable WCF hosing in IIS 7

  1. Raffaeu says:

    Great post Dude, on Windows 7 it works perfectly.
    You saved me a lot of time and headhake!

  2. virtual guru says:

    Very informative! got here in right time!


  3. thanks, this worked for me on Windows2008 using similar steps..via the Application Server mode…did this for 4.0 too.