title: Unable to access WCF service using NET.TCP binding
body: <p>I already asked a similar question here: <a href="https://stackoverflow.com/questions/22146035/unable-to-add-service-client-for-a-net-tcp-wcf-service">Unable to add service client for a net.tcp WCF service</a>. The problem was solved at that time. But now the same error is coming up. My configuration of WCF service is same as that of previous question. I am again posting it here:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
      &lt;services&gt;
        &lt;service name="CoreService.Service1" behaviorConfiguration="beh1"&gt;
          &lt;host&gt;
            &lt;baseAddresses&gt;
              &lt;add baseAddress="net.tcp://localhost/Service1.svc/mex" /&gt;
            &lt;/baseAddresses&gt;
          &lt;/host&gt;
          &lt;endpoint
       binding="netTcpBinding"
       bindingConfiguration="ultra"
       contract="CoreService.IAccountService"/&gt;
          &lt;endpoint
        binding="netTcpBinding"
        bindingConfiguration="ultra"
        contract="CoreService.IBoardService"/&gt;
          &lt;endpoint
        binding="netTcpBinding"
        bindingConfiguration="ultra"
        contract="CoreService.ICategoryService"/&gt;
  
          &lt;endpoint
                  address="mex"
                  binding="mexTcpBinding"
                  contract="IMetadataExchange"/&gt;
        &lt;/service&gt;
      &lt;/services&gt;
      &lt;bindings&gt;
        &lt;netTcpBinding&gt;
          &lt;binding name="ultra"
               maxBufferPoolSize="2147483647"
               maxBufferSize="2147483647"
               maxReceivedMessageSize="2147483647"
               portSharingEnabled="false"
               transactionFlow="false"
               listenBacklog="2147483647"
               sendTimeout="00:01:00"&gt;
            &lt;security mode="None"&gt;
              &lt;message clientCredentialType="None"/&gt;
              &lt;transport protectionLevel="None" clientCredentialType="None"/&gt;
            &lt;/security&gt;
            &lt;reliableSession enabled="false"/&gt;
          &lt;/binding&gt;
        &lt;/netTcpBinding&gt;
      &lt;/bindings&gt;
      &lt;behaviors&gt;
        &lt;serviceBehaviors&gt;
          &lt;behavior name="beh1"&gt;
            &lt;serviceMetadata httpGetEnabled="false" /&gt;
            &lt;serviceDebug includeExceptionDetailInFaults="True" /&gt;
            &lt;dataContractSerializer maxItemsInObjectGraph="65536" /&gt;
          &lt;/behavior&gt;
        &lt;/serviceBehaviors&gt;
      &lt;/behaviors&gt;
    &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>The error is:</p>
  
  <blockquote>
    <p>The URI prefix is not recognized. Metadata contains a reference that
    cannot be resolved: 'net.tcp://localhost/Service1.svc'. Could not
    connect to net.tcp://localhost/Service1.svc. The connection attempt
    lasted for a time span of 00:00:02.0051147. TCP error code 10061: No
    connection could be made because the target machine actively refused
    it 127.0.0.1:808.  No connection could be made because the target
    machine actively refused it 127.0.0.1:808 If the service is defined in
    the current solution, try building the solution and adding the service
    reference again.</p>
  </blockquote>
  
  <p>After the problem was solved, I didn't made any changes to the configuration and after some days it started showing that error again. I tried everything but nothing worked. Please help!</p>
  
  <p><strong>UPDATE</strong>: I am also able to access it using HTTP through my browser but unable to access using "Add Service Reference" option through net.tcp protocol.</p>