WCF 零个应用程序(非基础结构)终结点。请教。
WCF寄宿在一个Console程序里。配置文件如下:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<netMsmqBinding>
<binding name="Services.EmailService.Service.MsmgBinding" exactlyOnce="false">
<security mode="None">
</security>
</binding>
</netMsmqBinding>
</bindings>
<services>
<service name="WcfMsmqTest.ResponseService">
<endpoint address="net.msmq://192.168.1.88/private/KeedeEmailService"
binding="netMsmqBinding" bindingConfiguration="Keede.Services.EmailService.Service.MsmgBinding"
contract="Services.EmailService.Contract.IMailService" />
<host>
<baseAddresses>
<add baseAddress="http://192.168.1.88:4321/service" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
</configuration>
-------------
服务代码
ServiceHost _serviceHost = new ServiceHost(typeof(Keede.Services.EmailService.Service.MailService));
_serviceHost.Open();
-------------
运行时候会报错如下
零个应用程序(非基础结构)终结点。这可能是因为未找到应用程序的配置文件,或者在配置文件中未找到与服务名称匹配的服务元素,或者服务元素中未定义终结点。
-------------
查了 基本是webconfig问题,不过跟我以前的没撒区别,知道的赐教。