<bindings>
<netTcpBinding>
<binding name="sharePortBinding" closeTimeout="00:02:00" receiveTimeout="00:05:00"
sendTimeout="00:02:00" maxBufferPoolSize="524288000" maxBufferSize="655360000"
maxConnections="1000" maxReceivedMessageSize="655360000" portSharingEnabled="true">
<readerQuotas maxStringContentLength="655360000" />
</binding>
</netTcpBinding>
</bindings>
<services>
<service behaviorConfiguration="AdventureWorksDLinqDemo.ProductServiceBehavior"
name="AdventureWorksDLinqDemo.ProductService">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="sharePortBinding"
name="ProductService" contract="AdventureWorksDLinqDemo.IProductService" />
<endpoint address="net.tcp://localhost:5141/ProductService/MEX"
binding="mexTcpBinding"
contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://localhost:5140/ProductService" />
</baseAddresses>
<timeouts closeTimeout="00:10:00" />
</host>
</service>
</services>
=========================================================
当maxConnections > 10的时候,服务会抛出EndpointNotFoundException异常。
解决方法:
<endpoint address="net.tcp://localhost:5141/ProductService/MEX"
binding="mexTcpBinding"
contract="IMetadataExchange" />
修改mexTcpBinding的端口,不要与baseAddress的端口一样。