我有一个解决方案,包含一个WCF服务,一个Windows服务(用于托管它),以及一个WPF应用程序来使用它。我有一个“数据访问dll”,我正在从该服务引用它。当我搜索服务时,它会找到并引用它,而且还会生成app.config文件。
我的问题是,绑定信息没有全部更新。我的服务已配置了超时时间,但本地的app.config文件没有生成/更新。我通过手动添加解决了这个问题,现在可以正常工作;但是,我希望能够自动更新它们。
以下是服务绑定的配置:
我的问题是,绑定信息没有全部更新。我的服务已配置了超时时间,但本地的app.config文件没有生成/更新。我通过手动添加解决了这个问题,现在可以正常工作;但是,我希望能够自动更新它们。
以下是服务绑定的配置:
<bindings>
<netTcpBinding>
<binding name="StreamingBinding" receiveTimeout="00:15:00" sendTimeout="00:15:00"
transferMode="Streamed" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
当我引用服务时,生成的内容如下(请注意它缺少超时):
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_ITestService" transferMode="Streamed">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
有人知道我做错或者漏掉了什么吗?
提前感谢您!
根据下面的请求,这是我的服务端 app.config 和客户端 app.config:
服务端:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<appSettings>
<add key="aspnet:UseTaskFriendlySynchronizationContext" value="true" />
</appSettings>
<system.web>
<compilation debug="true" />
</system.web>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="StreamingBinding" receiveTimeout="00:15:00" sendTimeout="00:15:00"
transferMode="Streamed" maxBufferSize="2147483647" maxReceivedMessageSize="2147483647">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<services>
<service name="TestService.Wcf.TestServiceWcf">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="StreamingBinding"
contract="TestService.Wcf.ITestServiceWcf">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" bindingConfiguration=""
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:8525/TestServiceService" />
</baseAddresses>
</host>
</service>
</services>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
</system.serviceModel>
</configuration>
客户端:
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="NetTcpBinding_ITestServiceWcf" transferMode="Streamed">
<security mode="None" />
</binding>
</netTcpBinding>
</bindings>
<client>
<endpoint address="net.tcp://localhost:8525/TestServiceService"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_ITestServiceWcf"
contract="TestServiceService.ITestServiceWcf" name="NetTcpBinding_ITestServiceWcf">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>