title: WCF Multiple Bindings
body: <p>I'm getting the following error when I try multiple end points..</p>
  
  <pre><code>System.ServiceModel.AddressAlreadyInUseException: The TransportManager failed to listen on the supplied URI using the NetTcpPortSharing service: the service failed to listen.
     at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Register()
     at System.ServiceModel.Channels.SharedConnectionListener.SharedListenerProxy.Open(Boolean isReconnecting)
     at System.ServiceModel.Channels.SharedConnectionListener.StartListen(Boolean isReconnecting)
     at System.ServiceModel.Channels.SharedConnectionListener..ctor(BaseUriWithWildcard baseAddress, Int32 queueId, Guid token, OnDuplicatedViaDelegate onDuplicatedViaCallback)
     at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpenInternal(Int32 queueId, Guid token)
     at System.ServiceModel.Channels.SharedTcpTransportManager.OnOpen()
     at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
     at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
     at System.ServiceModel.Channels.TransportChannelListener.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.ConnectionOrientedTransportChannelListener.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.TcpChannelListener`2.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
     at System.ServiceModel.Channels.ReliableChannelListenerBase`1.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
     at System.ServiceModel.Dispatcher.ChannelDispatcher.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
     at System.ServiceModel.ServiceHostBase.OnOpen(TimeSpan timeout)
     at System.ServiceModel.Channels.CommunicationObject.Open(TimeSpan timeout)
     at System.ServiceModel.Channels.CommunicationObject.Open()
     at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)
  </code></pre>
  
  <p>Here's my App.Config contents</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
    &lt;system.web&gt;
      &lt;compilation debug="true" /&gt;
    &lt;/system.web&gt;
    &lt;!-- When deploying the service library project, the content of the config file must be added to the host's 
    app.config file. System.Configuration does not support config files for libraries. --&gt;
    &lt;system.serviceModel&gt;
      &lt;bindings&gt;
        &lt;netTcpBinding&gt;
          &lt;binding name="tcpBinding" transferMode="Buffered" portSharingEnabled="true"&gt;
            &lt;reliableSession enabled="true" /&gt;
            &lt;security mode="None"&gt;
              &lt;transport clientCredentialType="None" protectionLevel="None" /&gt;
              &lt;message clientCredentialType="None" /&gt;
            &lt;/security&gt;
          &lt;/binding&gt;
        &lt;/netTcpBinding&gt;
      &lt;/bindings&gt;
      &lt;services&gt;
        &lt;service behaviorConfiguration="WcfServiceLibrary1.Service1Behavior"
          name="WcfServiceLibrary1.Service1"&gt;
          &lt;endpoint address="" binding="wsHttpBinding" contract="WcfServiceLibrary1.IService1"&gt;
            &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;
          &lt;endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /&gt;
          &lt;endpoint address="Service" binding="netTcpBinding" bindingConfiguration="tcpBinding"
            name="testTcp" contract="WcfServiceLibrary1.IService1" /&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="http://localhost:8731/Design_Time_Addresses/WcfServiceLibrary1/Service1/" /&gt;
              &lt;add baseAddress="net.tcp://localhost:8731/Design_Time_Addresses/WcfServiceLibrary1/Service" /&gt;
  
            &lt;/baseAddresses&gt;
  
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="WcfServiceLibrary1.Service1Behavior"&gt;
            &lt;!-- To avoid disclosing metadata information, 
            set the value below to false and remove the metadata endpoint above before deployment --&gt;
            &lt;serviceMetadata httpGetEnabled="True"/&gt;
            &lt;!-- To receive exception details in faults for debugging purposes, 
            set the value below to true.  Set to false before deployment 
            to avoid disclosing exception information --&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="False" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  &lt;/configuration&gt;
  </code></pre>
  
  <p>Would be great if someone could guide me where I'm wrong.</p>
  
  <p>Net TCP port sharing service is enabled both in App.Config and Windows Service.That's as far as I could possibly check.</p>