VB.net中的WCF命名管道问题

时间:2013-10-08 05:23:53

标签: .net wcf

我正在尝试使用WCF测试客户端来测试我的WCF服务,这是我的app.config。这很好用,但当我将baseAddress更改为“net.pipe:// localhost / VSWCFPipe”时,它不再有效。将baseAddress更改为命名管道的正确方法是什么?我只想使用net.pipe,因为这只适用于本地计算机上的IPC。

<?xml version="1.0" encoding="utf-8" ?>
<configuration>
  <system.serviceModel>
    <services>
      <service behaviorConfiguration="WCFServiceBehavior"
        name="WCFEngineService.WCFService">
        <clear />
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange"
          listenUriMode="Explicit">
          <identity>
            <dns value="localhost" />
            <certificateReference storeName="My" storeLocation="LocalMachine"
              x509FindType="FindBySubjectDistinguishedName" />
          </identity>
        </endpoint>
        <endpoint address="net.pipe://localhost/VSWCFPipe" binding="netNamedPipeBinding"
          bindingConfiguration="" contract="WCFEngineService.IWCF" />
        <host>
          <baseAddresses>
            <add baseAddress="http://localhost:8888/WCFEngineService/Service" />
          </baseAddresses>
        </host>
      </service>
    </services>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WCFServiceBehavior">
          <serviceMetadata httpGetEnabled="true"/>
          <serviceDebug includeExceptionDetailInFaults="False"/>
        </behavior>
      </serviceBehaviors>
    </behaviors>
  </system.serviceModel>
</configuration>

1 个答案:

答案 0 :(得分:0)

根据我的理解,您错过了在启用的协议列表中添加 net.pipe 协议。请完成以下步骤并确认设置是否正确。

  1. 转到IIS(在运行窗口中输入 inetmgr
  2. 从左侧窗格中选择并右键单击您的服务。
  3. 选择管理应用程序----&gt;右键单击上下文菜单中的“高级设置”菜单。
  4. 在“高级设置”窗口中,选择已启用协议属性。
  5. 默认情况下会添加http协议。通过逗号分隔符添加 net.pipe 。例如: http,net.pipe
相关问题