所以我有我的命名管道声明如下:
DuplexChannelFactory<IServiceHandler> pipeFactory;pipeFactory =
new DuplexChannelFactory<IServiceHandler>(
myCallbacks,
new NetNamedPipeBinding(),
new EndpointAddress(
"net.pipe://localhost/Server"));
pipeProxy = pipeFactory.CreateChannel();
(这个工作)
我想把配置放在 app.config 文件中,所以我去那里做它:
<client>
<endpoint address="net.pipe://localhost/Server" binding="netNamedPipeBinding"
bindingConfiguration="netNamedPipeBinding" contract="WCFClient.IServiceHandler"
name="ClientEndpointinClient" />
.
.
.
然后从声明中删除配置:
pipeFactory =
new DuplexChannelFactory<IServiceHandler>(
myCallbacks);
pipeProxy = pipeFactory.CreateChannel();
不用担心回调,它们已经很好地声明了。但是当我尝试创建通道时,它说端点为空......
我错过了什么?