To install the core components of IIS and resources to support TCP in WCF, open the command prompt (as administrator) and run:

Dism.exe /online /Enable-Feature /FeatureName:IIS-WebServerRole /FeatureName:IIS-WebServerRole /FeatureName:IIS-WebServer /FeatureName:IIS-ApplicationDevelopment /FeatureName:IIS-Security /FeatureName:IIS-RequestFiltering /FeatureName:IIS-NetFxExtensibility /FeatureName:WAS-WindowsActivationService /FeatureName:WAS-ProcessModel /FeatureName:WAS-NetFxEnvironment /FeatureName:WAS-ConfigurationAPI /FeatureName:NetFx3 /FeatureName:WCF-HTTP-Activation /FeatureName:WCF-NonHTTP-Activation

Or if you already have IIS installed and you only want to enable the features to support TCP execute:

Dism.exe /online /Enable-Feature /FeatureName:WCF-HTTP-Activation /FeatureName:WCF-NonHTTP-Activation

Run the following command to register ASP.NET:

%WINDIR%\Microsoft.NET\Framework\v4.0.30319\aspnet_regiis.exe -iru

And at the end do an IIS reset by:


At this point, it was installed in IIS support for TCP and we still need to configure the applications to use this protocol. Here is an example.

In a Visual Studio Web application on the server settings change to the IIS and create a virtual directory:


Open IIS (run inetmgr), and enable net.tcp protocol in the Web Application. Thus it is:


Do the same for each Website. Set the Enabled protocols such as http,net.tcp.


These settings cause the IIS listen to the TCP protocol on port 808 (you can change the port in IIS bindings and configuration files later).

Going back to Visual Studio, change the Web.config file for the following settings:

      <behavior name="">
        <serviceMetadata httpGetEnabled="true"
                         httpsGetEnabled="true" />
        <serviceDebug includeExceptionDetailInFaults="false" />
    <service name="WcfCaller.Services.HelloWorld">
      <endpoint address="" binding="netTcpBinding" 
                contract="WcfCaller.Services.IHelloWorld" />
      <endpoint address="mex" binding="mexTcpBinding" 
          <add baseAddress="net.tcp://localhost:808/WcfCaller.Services"/>
  <serviceHostingEnvironment aspNetCompatibilityEnabled="true"
    multipleSiteBindingsEnabled="true" />

We will now add the reference to this service in a client application. Like in the image below (note the net.tcp protocol at the beginning of the URL):


At the end of the process Visual Studio will generate some settings and should look like this:

      <binding name="NetTcpBinding_IHelloWorld" />
    <endpoint address="net.tcp://localhost/WcfCaller.Services/HelloWorld.svc"
      binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IHelloWorld"
      contract="HelloWorld.IHelloWorld" name="NetTcpBinding_IHelloWorld">
        <servicePrincipalName value="DOMAIN/UserName" />