title: How to solve "The ChannelDispatcher is unable to open its IChannelListener" error?
body: <p>I'm trying to communicate between WCF hosted in Windows Service and my service GUI. The problem is when I'm trying to execute OperationContract method I'm getting</p>
  
  <blockquote>
    <p>"The ChannelDispatcher at
    'net.tcp://localhost:7771/MyService'
    with contract(s) '"IContract"' is
    unable to open its IChannelListener."</p>
  </blockquote>
  
  <p>My app.conf looks like that:</p>
  
  <pre><code>&lt;configuration&gt;
  &lt;system.serviceModel&gt;
      &lt;bindings&gt;
          &lt;netTcpBinding&gt;
              &lt;binding name="netTcpBinding"&gt;
                  &lt;security&gt;
                      &lt;transport protectionLevel="EncryptAndSign" /&gt;
                  &lt;/security&gt;
              &lt;/binding&gt;
          &lt;/netTcpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
          &lt;serviceBehaviors&gt;
              &lt;behavior name="MyServiceBehavior"&gt;
                  &lt;serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:7772/MyService" /&gt;
                  &lt;serviceDebug includeExceptionDetailInFaults="true" /&gt;
              &lt;/behavior&gt;
          &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
      &lt;services&gt;
          &lt;service behaviorConfiguration="MyServiceBehavior"
              name="MyService.Service"&gt;
              &lt;endpoint address="net.tcp://localhost:7771/MyService" binding="netTcpBinding"
                  bindingConfiguration="netTcpBinding" name="netTcp" contract="MyService.IContract" /&gt;
          &lt;/service&gt;
      &lt;/services&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p></p>
  
  <p>Port 7771 is listening (checked using netstat) and svcutil is able to generate configs for me. </p>
  
  <p>Any suggestions would be appreciated.</p>
  
  <hr>
  
  <p>Stack trace from exception</p>
  
  <blockquote>
  <pre><code>Server stack trace: 
     at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter)
     at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc&amp; rpc)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout)
     at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs)
     at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation)
     at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
  </code></pre>
  </blockquote>
  
  <hr>
  
  <p>There's one inner exeption (but not under Exeption.InnerExeption but under Exeption.Detail.InnerExeption - ToString() method doesn't show that)</p>
  
  <blockquote>
    <p>A registration already exists for URI 'net.tcp://localhost:7771/MyService'.</p>
  </blockquote>
  
  <p>But my service have specified this URI only in app.config file nowhere else. In entire solution this URI apears in server once and client once.</p>