title: There is already a listener on IP endpoint 0.0.0.0:13000. ?? (TCP using WCF)
body: <p>I'm trying to figure out why the port is being used even after restarting the computer!</p>
  
  <blockquote>
    <p>System.ServiceModel.AddressAlreadyInUseException: There is already a listener on IP endpoint 0.0.0.0:13000. This could happen if there is another application already listening on this endpoint or if you have multiple service endpoints in your service host with the same IP endpoint but with incompatible binding configurations. ---> System.Net.Sockets.SocketException: Only one usage of each socket address (protocol/network address/port) is normally permitted
           at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
           at System.Net.Sockets.Socket.Bind(EndPoint localEP)
           at System.ServiceModel.Channels.SocketConnectionListener.Listen()
           --- End of inner exception stack trace ---
           at System.ServiceModel.Channels.SocketConnectionListener.Listen()
           at System.ServiceModel.Channels.TracingConnectionListener.Listen()
           at System.ServiceModel.Channels.ConnectionAcceptor.StartAccepting()
           at System.ServiceModel.Channels.ExclusiveTcpTransportManager.OnOpen()
           at System.ServiceModel.Channels.TransportManager.Open(TransportChannelListener channelListener)
           at System.ServiceModel.Channels.TransportManagerContainer.Open(SelectTransportManagersCallback selectTransportManagerCallback)
           at System.ServiceModel.Channels.TcpChannelListener`2.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 Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)
        System.Net.Sockets.SocketException (0x80004005): Only one usage of each socket address (protocol/network address/port) is normally permitted
           at System.Net.Sockets.Socket.DoBind(EndPoint endPointSnapshot, SocketAddress socketAddress)
           at System.Net.Sockets.Socket.Bind(EndPoint localEP)
           at System.ServiceModel.Channels.SocketConnectionListener.Listen()</p>
  </blockquote>
  
  <p>How do you figure out which process is listening to that port (13000)? Netstat shows nothing on that port.</p>
  
  <p>Here's my App.config:</p>
  
  <pre><code>  &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;services&gt;
        &lt;service name="SomeTarget.SomeTargetService"&gt;
          &lt;endpoint address="" binding="customBinding" bindingConfiguration="NetTcpBinding"
            contract="SomeTarget.ISomeTargetService"&gt;
            &lt;identity&gt;
              &lt;dns value="localhost" /&gt;
            &lt;/identity&gt;
          &lt;/endpoint&gt;
          &lt;endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
            contract="IMetadataExchange" /&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="net.tcp://localhost:13000" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
        &lt;/service&gt;
      &lt;/services&gt;
  
      &lt;bindings&gt;
        &lt;customBinding&gt;
          &lt;binding name="NetTcpBinding" sendTimeout="00:05:00" closeTimeout="00:00:30" openTimeout="00:00:30" receiveTimeout="00:05:00"&gt;
            &lt;transactionFlow /&gt;
            &lt;binaryMessageEncoding /&gt;
            &lt;windowsStreamSecurity protectionLevel="None" /&gt;
            &lt;tcpTransport maxBufferPoolSize="524288"
                          maxReceivedMessageSize="1024"
                          maxBufferSize="1024" &gt;
              &lt;connectionPoolSettings groupName="default" leaseTimeout="00:05:00"
                                      idleTimeout="00:02:00" maxOutboundConnectionsPerEndpoint="20" /&gt;
            &lt;/tcpTransport&gt;
          &lt;/binding&gt;
        &lt;/customBinding&gt;
      &lt;/bindings&gt;
  
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name=""&gt;
            &lt;serviceMetadata httpGetEnabled="false" httpsGetEnabled="false" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="false" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  
  &lt;/configuration&gt;
  </code></pre>