0
votes

Since the development server doesn't support the use of any bindings besides HTTP (http://social.msdn.microsoft.com/Forums/en-US/wcf/thread/c7f173ea-61dc-4338-8883-60d616adc18f/), then how does one debug a NetNamedPipeBinding?

Right now, when I change the binding type with the Microsoft Service Configuration Editor from basicHttpBinding to netNamedPipeBinding, then I get the following error message when I try to hit F5 to use the auto-generated WCF tool that pops up.

System.InvalidOperationException: Could not find a base address that matches scheme net.pipe for the endpoint with binding NetNamedPipeBinding. Registered base address schemes are [http]. at System.ServiceModel.ServiceHostBase.MakeAbsoluteUri(Uri relativeOrAbsoluteUri, Binding binding, UriSchemeKeyedCollection baseAddresses) at System.ServiceModel.Description.ConfigLoader.LoadServiceDescription(ServiceHostBase host, ServiceDescription description, ServiceElement serviceElement, Action`1 addBaseAddress) at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, ServiceElement serviceSection) at System.ServiceModel.ServiceHostBase.LoadConfigurationSectionInternal(ConfigLoader configLoader, ServiceDescription description, String configurationName) at System.ServiceModel.ServiceHostBase.ApplyConfiguration() at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) at System.ServiceModel.ServiceHost.InitializeDescription(Type serviceType, UriSchemeKeyedCollection baseAddresses) at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) at Microsoft.Tools.SvcHost.ServiceHostHelper.CreateServiceHost(Type type, ServiceKind kind) at Microsoft.Tools.SvcHost.ServiceHostHelper.OpenService(ServiceInfo info)

Config:

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <configSections>
  </configSections>
  <system.web>
    <compilation debug="true" />
  </system.web>
  <!-- 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. -->
  <system.serviceModel>
    <bindings>
      <netNamedPipeBinding>
        <binding name="NewBinding0" />
      </netNamedPipeBinding>
    </bindings>
    <services>
      <service behaviorConfiguration="InventoryServiceLibrary.Service1Behavior"
        name="InventoryServiceLibrary.InventoryService">
        <endpoint address="" binding="netNamedPipeBinding" bindingConfiguration=""
          contract="InventoryServiceLibrary.IInventoryService">
          <identity>
            <dns value="localhost" />
          </identity>
        </endpoint>
        <endpoint address="mex" binding="mexHttpBinding" bindingConfiguration=""
          contract="IMetadataExchange" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8731/Design_Time_Addresses/InventoryServiceLibrary/Service1/" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="InventoryServiceLibrary.Service1Behavior">
          <!-- To avoid disclosing metadata information, 
          set the value below to false and remove the metadata endpoint above before deployment -->
          <serviceMetadata httpGetEnabled="True"/>
          <!-- 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 -->
          <serviceDebug includeExceptionDetailInFaults="False" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

Solution Add a base address after creating a named pipe binding

3
Do you have a net.pipe base address configured?John Saunders
I beleive that WCF net pipes don't support cross machine calls - are you trying to do thse?Preet Sangha
I can't find a way to set net.pipe in the Configuration Editor. No, I only want to talk between two processes on the same computer.Zian Choy

3 Answers

3
votes

Show us your config !! Both for the client and the server.

The message "Could not find a base address that matches scheme net.pipe for the endpoint with binding NetNamedPipeBinding." basically says it all - it would appear as if your server config does not contain any endpoints or base addresses that use the net.pipe binding:

<services>
   <service name="xxxx">
       <host>
           <baseAddresses>
               <add baseAddress="http://localhost:8000/MyService" />
               <add baseAddress="net.tcp://localhost:8100/MyService" />
               <add baseAddress="net.pipe://localhost/" />

You'll also need to specify at least one net.pipe endpoint in your server's config in order to use this protocol.

As other have also commented, WCF allow net.pipe binding only for local machine calls, e.g. you cannot call from one physical machine to another. If you need that capability, use the net.tcp binding instead.

Marc

1
votes

You could always just use Attach To Process instead of directly starting in the debugger and attach it to your host process.

0
votes

These answers are misleading. If you are self-hosting a WCF service you will need the Base Address section. If you are hosting using IIS however, it is not required and not used.