我有以下工作方案的配置(服务器端)WCF:改造计划配置到的app.config
using (ServiceHost host = new ServiceHost(
typeof(RequestHandler),
new Uri[] { new Uri("net.pipe://localhost") }))
{
NetNamedPipeBinding tBinding = new NetNamedPipeBinding();
host.AddServiceEndpoint(typeof(RequestInterface),
tBinding, "Request");
host.Open();
Application.Run(new Form1());
}
试图把它变成代码app.config
:
<system.serviceModel>
<bindings>
<netNamedPipeBinding>
<binding
closeTimeout="00:01:00"
openTimeout="00:01:00"
receiveTimeout="00:10:00"
sendTimeout="00:01:00"
transactionFlow="false"
transferMode="Buffered"
transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard"
maxBufferPoolSize="524288"
maxBufferSize="65536"
maxConnections="10"
maxReceivedMessageSize="65536">
<security mode="Transport">
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netNamedPipeBinding>
</bindings>
<services>
<service name="ServerApp.RequestHandler">
<host>
<add baseAddress="net.pipe://localhost/" />
</host>
<endpoint address="net.pipe://localhost/Request/"
binding="netNamedPipeBinding"
contract="AppLib.RequestInterface" />
</service>
</services>
但是,这似乎不起作用 - 即客户端无法连接到此。
我的app.config代码有问题吗? 或者我必须通过编程来告诉.NET使用app.config中的配置吗?
好像这个工具有点过时了。我无法打开.NET 4.0程序集(它告诉我程序集针对的是.NET的更新版本,而不是该工具支持的程序集)。我试图添加一个新的服务 – yas4891 2011-05-26 15:23:52
它在那里...你可能正在寻找旧版本框架的错误路径。或者,您应该可以通过Visual Studio的“工具> WCF服务配置编辑器”菜单项访问它 – 2011-05-26 17:30:36