private IMessagePublishService createProxy()
{
using (DuplexChannelFactory<IMessagePublishService> cf =
new DuplexChannelFactory<IMessagePublishService>("messagepublishservice"))
{
IMessagePublishService proxy = cf.CreateChannel();
return proxy;
}
}
就是这里的cf.CreateChannel()报错。内容为:“ChannelFactory.Endpoint 上的地址属性为空。ChannelFactory 的终结点必须指定一个有效的地址。”
APP.CONFIG里面已经配置了终结点信息
<system.serviceModel>
<client>
<endpoint address="net.tcp://127.0.0.1:9999/MessagePublishService"
binding="netTcpBinding"
contract="WcfServiceLibrary.IMessagePublishService"
name="messagepublishservice"
/>
</client>
</system.serviceModel>
哪位大侠知道问题之所在,请指教,小弟感激不尽。