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:

iireset

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:

Web01

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

Web03-1

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

Web03

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:

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

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):

Web05

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

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