我的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 服务时,报出黄页,错误如下
我查了一些资料,有人说在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啊~~~
幕布斯6054654
幕布斯7119047