title: How do I set the Name of Net Named Pipes in WCF when hosted in ASP .NET?
body: <p>First a bit of background:</p>
  
  <p>I have a web server which runs 4 instances of the same ASP .NET application each one in a different culture (set in the web.config). The cultures are British (GBR), Australian (AUS), Irish (IRL), and New Zealander (NZL). Each of them has a webmethod "DoWork" which I would like to call via a single scheduled task. I have a simple exe which calls this method on each of the four cultures, simplified code:</p>
  
  <pre><code>Dim AUSclient As New AUSAutomated.AUSAutomatedClient()
  AUSclient.DoWork
  Dim GBRclient As New GBRAutomated.GBRAutomatedClient()
  GBRclient.DoWork
  Dim IRLclient As New IRLAutomated.IRLAutomatedClient()
  IRLclient.DoWork
  Dim NZLclient As New NZLAutomated.NZLAutomatedClient()
  NZLclient.DoWork
  </code></pre>
  
  <p>In the task which is consuming the methods the app.config looks like this:</p>
  
  <p>
                      </p>
  
  <pre><code>        &lt;endpoint address="net.pipe://localhost/Services/GBR/GBRAutomated.svc"
              binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IGBRAutomated"
              contract="GBRAutomated.IGBRAutomated" name="NetNamedPipeBinding_IGBRAutomated"&gt;
                  &lt;/endpoint&gt;
  
          &lt;endpoint address="net.pipe://localhost/Services/IRL/IRLAutomated.svc"
   binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IIRLAutomated"
   contract="IRLAutomated.IIRLAutomated" name="NetNamedPipeBinding_IIRLAutomated"&gt;
                      &lt;/endpoint&gt;
  
          &lt;endpoint address="net.pipe://localhost/Services/NZL/NZLAutomated.svc"
              binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_INZLAutomated"
              contract="NZLAutomated.INZLAutomated" name="NetNamedPipeBinding_INZLAutomated"&gt;
                      &lt;/endpoint&gt;
  </code></pre>
  
  <p>The application exposes the web method via WCF using a net named pipes binding. Each of the cultures has an entry in the web.config to point to the correct service. For example the Ireland one is:</p>
  
  <pre><code>&lt;service name="Web.IRLAutomated"&gt;
              &lt;endpoint address="net.pipe://localhost/Services/IRL/IRLAutomated.svc" binding="netNamedPipeBinding" contract="Web.IIRLAutomated" /&gt;
          &lt;/service&gt;
  </code></pre>
  
  <p>So the exposed method for each culture has a different contract and address.</p>
  
  <p>When the task runs it calls the Australian Method all 4 times. It seems to ignore the settings in the web.configs and call the method with the correct contract on the first application. So my question is:</p>
  
  <p><strong>How can I set a unique pipe name for the method in each culture?</strong> </p>
  
  <p>I tried setting hostNameComparisonMode="Exact" on the binding but this doesn't seem to have made any difference.</p>