首页 新闻 会员 周边 捐助

[WCF]:Could not find a base address that matches scheme net.pipe for the endpoint with binding NetNamedPipeBinding

0
悬赏园豆:50 [已解决问题] 解决于 2011-03-29 10:30

我的web.config中wcf的配置如下:

 

 <system.serviceModel>
    <behaviors>
      <serviceBehaviors>
        <behavior name="WCFHostDemo.Contracts.Lib.HelloWorldServiceBehavior">
          <serviceMetadata httpGetEnabled="true" />
          <serviceDebug includeExceptionDetailInFaults="true" />
        </behavior>
      </serviceBehaviors>
    </behaviors>
    <services>
      <service behaviorConfiguration="WCFHostDemo.Contracts.Lib.HelloWorldServiceBehavior"
          name="WCFHostDemo.Contracts.Lib.HelloWorldService">
        <endpoint address="wsHttp" binding="wsHttpBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>
        <endpoint address="netPipe" binding="netNamedPipeBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>
        <endpoint address="basicHttp" binding="basicHttpBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <!--<endpoint address="netTcp" binding="netTcpBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>-->
      </service>
    </services>
  </system.serviceModel>

但是当我试图运行这个 webapplication 为宿主的wcf 服务时,报出黄页,错误如下

Could not find a base address that matches scheme net.pipe for the endpoint with binding NetNamedPipeBinding. Registered base address schemes are [http].

我查了一些资料,有人说在services节点下面添加host节点,具体如下

<services>
      <service behaviorConfiguration="WCFHostDemo.Contracts.Lib.HelloWorldServiceBehavior"
          name="WCFHostDemo.Contracts.Lib.HelloWorldService">
        <endpoint address="wsHttp" binding="wsHttpBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>
        <endpoint address="netPipe" binding="netNamedPipeBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>
        <endpoint address="basicHttp" binding="basicHttpBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>
        <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
        <!--<endpoint address="netTcp" binding="netTcpBinding" contract="WCFHostDemo.Contracts.Lib.IHelloWorldService"></endpoint>-->
        <host>
          <baseAddresses>

            <add baseAddress = "net.pipe://localhost/"/>
          </baseAddresses>
        </host>
      </service>
    </services>

但是我依然得到前面的错误提示,郁闷!!!!!!!!!!

麻烦请问各位大侠,这个issue 如何fixed啊~~~

dbms的主页 dbms | 初学一级 | 园豆:75
提问于:2011-03-28 16:46
< >
分享
最佳答案
0
收获园豆:30
2012 | 高人七级 |园豆:21645 | 2011-03-28 17:48
经过一夜的查找,小弟终于弄出来了:具体如下
选中你发布的website,右键Edit Binding,添加net.tcp,binding information为808:*;在添加net.pipe, binding information为*;然后右键Manage Web site->Advanced Setting->Enable protocals在里面输入net.tcp和net.pipe并以","隔开;在此之前首先要去人你的was以及其相关服务已经开启,并且已经安装了net.tcp的服务(运行.net文件夹下的v3.0文件夹下的Windows Communication foundation文件夹下的ServiceModelReg.exe -i即可安装),再次运行website it is ok!!
dbms | 园豆:75 (初学一级) | 2011-03-29 10:29
其他回答(1)
0

单纯的web部署,不支持tcp,pipe。

收获园豆:20
arg | 园豆:1047 (小虾三级) | 2011-03-28 17:01
那如何才能支持net.tcp或者named pipe啊?我在host这边已经开启了was的功能和相关的服务了
支持(0) 反对(0) dbms | 园豆:75 (初学一级) | 2011-03-28 17:03
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册