title: Can't add WCF service reference to client project using netTcpBinding
body: <p>I have a WCF service that uses NetTcpBinding and I'd like to host it in a WPF application. The  service seems to start correctly, but when I'm trying to get it's metadata using 'Add service reference' in visual studio I get this exception:</p>
  
  <pre><code>The URI prefix is not recognized.
  Metadata contains a reference that cannot be resolved: 'net.tcp://localhost:8000/Mandrake/mex'.
  </code></pre>
  
  <p>My service project's App.config file:</p>
  
  <pre><code>&lt;?xml version="1.0" encoding="utf-8" ?&gt;
  &lt;configuration&gt;
  
  &lt;appSettings&gt;
      &lt;add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" /&gt;
  &lt;/appSettings&gt;
  &lt;system.web&gt;
    &lt;compilation debug="true" /&gt;
  &lt;/system.web&gt;
  &lt;system.serviceModel&gt;
    &lt;services&gt;
      &lt;service name="Mandrake.Service.OTAwareService"&gt;
        &lt;endpoint address="OTService" binding="netTcpBinding" contract="Mandrake.Service.IOTAwareService"&gt;
          &lt;identity&gt;
            &lt;dns value="localhost" /&gt;
          &lt;/identity&gt;
        &lt;/endpoint&gt;
        &lt;endpoint name="MEX" address="mex" binding="mexTcpBinding" contract="IMetadataExchange" /&gt;
        &lt;host&gt;
          &lt;baseAddresses&gt;
            &lt;add baseAddress="net.tcp://localhost:8000/Mandrake/" /&gt;
          &lt;/baseAddresses&gt;
        &lt;/host&gt;
      &lt;/service&gt;
    &lt;/services&gt;
    &lt;behaviors&gt;
      &lt;serviceBehaviors&gt;
        &lt;behavior&gt;
          &lt;serviceMetadata/&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>And the code in the hosting application:</p>
  
  <pre><code>Uri baseAddress = new Uri("net.tcp://localhost:8000/Mandrake");
  ServiceHost host = new ServiceHost(typeof(OTAwareService), baseAddress);
  
  try
  {
      host.AddServiceEndpoint(typeof(IOTAwareService), new NetTcpBinding(), "OTService");
  
  }
  catch (CommunicationException e)
  {
      Console.WriteLine(e.Message);
      host.Abort();
  }
  </code></pre>
  
  <p>The solutions I found to the problem were mainly about adding the 'serviceMetaData' to the service config or providing a mex endpoint. Could you suggest something?</p>
  
  <p><strong>Edit:</strong></p>
  
  <p>Final config:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="NewBehavior0"&gt;
        &lt;serviceMetadata /&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="True" /&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;services&gt;
    &lt;service name="Mandrake.Service.OTAwareService" behaviorConfiguration="NewBehavior0"&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress="net.tcp://localhost:8036/OTService"/&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
  
      &lt;endpoint address="" binding="netTcpBinding" name="TcpEndpoint" contract="Mandrake.Service.IOTAwareService" /&gt;
      &lt;endpoint address="mex" binding="mexTcpBinding" name="MetadataEndpoint" contract="IMetadataExchange" /&gt;
  
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;/system.serviceModel&gt;
  </code></pre>
  
  <p>Hosting application:</p>
  
  <pre><code>host = new ServiceHost(typeof(OTAwareService));
  host.Open();
  </code></pre>