I have a solution that contains a WCF service, a Windows service (for hosting it) and a WPF application for using it. I have a "data access dll" that I reference the service. When I look for a solution for a service, it finds it and refers to it without any problems, and also creates an app.config file for it.
The problem I encountered is that the binding information is not all updated. In my service, timeouts are configured that are not created / updated in the local app.config file. I was able to get around it by simply adding them manually, and it works great; however, I would like to be able to update them automatically.
This is the service binding configuration:
<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>