title: WCF NetNamedPipeBinding Service NorthwindService example vs MyService
body: <p>I have complete exhausted resources on trying to get NetNamedPipeBinding for my WCF Service working. I was able to get the NorthwindService example working found here.</p>
  
  <p>For the NorthwindService example, I have the following:</p>
  
  <pre><code>namespace NorthwindServices
  {
     public class Customer : ICustomer
     {
          public string GetCustomerName(int CustomerID)
          {
              return CustomerID.ToString();
          }
     }
  }
  
  namespace NorthwindServices
  {
      [ServiceContract]
      public interface ICustomer
      {
          [OperationContract]
          string GetCustomerName(int CustomerID);
      }
  }
  </code></pre>
  
  <p>And the configuration for the example is the following:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;services&gt;
    &lt;service name="NorthwindServices.Customer"
             behaviorConfiguration="ServiceBehavior"&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress="net.pipe://localhost/NorthwindServices/Customer"/&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
      &lt;!-- Service Endpoints --&gt;
      &lt;!-- Unless fully qualified, address is relative to base address supplied above --&gt;
      &lt;endpoint address="CustomerService" binding="netNamedPipeBinding" contract="NorthwindServices.ICustomer"/&gt;
      &lt;endpoint address="CustomerService/mex" binding="mexNamedPipeBinding" contract="IMetadataExchange"/&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="ServiceBehavior"&gt;
        &lt;!-- To avoid disclosing metadata information, 
        set the values below to false before deployment --&gt;
        &lt;serviceMetadata httpGetEnabled="False" httpsGetEnabled="False"/&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;
  </code></pre>
  
  <p></p>
  
  <p>I have an IIS Site defined for this with the details below:</p>
  
  <p><img src="https://i.stack.imgur.com/ZmlHZ.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/CzmBR.png" alt="enter image description here"></p>
  
  <p><img src="https://i.stack.imgur.com/E4nHC.png" alt="enter image description here"></p>
  
  <p>So when I go to 'Add Service Reference' I can pull in the reference perfectly fine.</p>
  
  <p><img src="https://i.stack.imgur.com/xB8Gr.png" alt="enter image description here"></p>
  
  <p>However, when I try to do the same in my actual application, I still cannot seem to figure it out. I am unable to pull in the reference.</p>
  
  <p>The site structure is the following:</p>
  
  <pre><code>The top level site is an MVC site, and there is an "API" virtual directory below it where the service resides that I am trying to expose over NetNamedPipeBinding.
  </code></pre>
  
  <p><img src="https://i.stack.imgur.com/u50Gs.png" alt="enter image description here"></p>
  
  <p>The bindings for the site are the following:
  <img src="https://i.stack.imgur.com/UCQPV.png" alt="enter image description here"></p>
  
  <p>The config for the service I am trying to expose over named pipes is the following:</p>
  
  <pre><code>&lt;system.serviceModel&gt;
  &lt;services&gt;
    &lt;service name="Site.API.Service.WorkItemQueueService"
             behaviorConfiguration="ServiceBehavior"&gt;
      &lt;host&gt;
        &lt;baseAddresses&gt;
          &lt;add baseAddress="net.pipe://localhost/WorkItemQueueService"/&gt;
        &lt;/baseAddresses&gt;
      &lt;/host&gt;
      &lt;endpoint address="QueueService"
                binding="netNamedPipeBinding"
                contract="Site.API.Service.IWorkItemQueueService"/&gt;
      &lt;endpoint address="QueueService/mex"
                binding="mexNamedPipeBinding"
                contract="IMetadataExchange"/&gt;
    &lt;/service&gt;
  &lt;/services&gt;
  &lt;behaviors&gt;
    &lt;serviceBehaviors&gt;
      &lt;behavior name="ServiceBehavior"&gt;
        &lt;serviceMetadata httpGetEnabled="false"/&gt;
        &lt;serviceDebug includeExceptionDetailInFaults="false"/&gt;
      &lt;/behavior&gt;
    &lt;/serviceBehaviors&gt;
  &lt;/behaviors&gt;
  &lt;serviceHostingEnvironment multipleSiteBindingsEnabled="True" aspNetCompatibilityEnabled="True"/&gt;
  </code></pre>
  
  <p></p>
  
  <p>The service implementation is the same as the customer service above, but obviously renamed to match the configuration above.</p>
  
  <p>When I try to add a service reference, or find the metadata for this, It cannot find it.</p>
  
  <p><img src="https://i.stack.imgur.com/6w0ez.png" alt="enter image description here"></p>
  
  <p><strong>IMPORTANT</strong> - All of the pre configuration items such as starting the Net Pipe listerner and role service have been completed, hence the NorthwindServices example works.</p>