自己ホストされ、別のサービスを介して開始された WCF サービスがあります。Visual Studio でデバッグするとapp.config
、サービス クライアントのエンドポイント構成を追加するまで問題なく動作します。このサービスの一部のクライアントはローカルであり、他のクライアントはリモートです。サービスを指しているクライアントエンドポイントがあり、エンドポイントを使用しているクライアントがある場合、名前付きパイプのクライアントエンドポイントのみを使用しようとしました(サービスが開始しようとする時点でインスタンス化されるべきではありませんが)例外が発生します0.0.0.0:8524 が使用されていることを教えてくれます。関連する構成は次のとおりです。
<service name="EventService.EventPublishingService">
<clear />
<endpoint binding="netTcpBinding" address="net.tcp://localhost:8524/EventPublishingService" contract="EventService.Contracts.IEventPublishService">
</endpoint>
<endpoint address="net.tcp://localhost:8524/EventPublishingService/mex" binding="mexTcpBinding" contract="IMetadataExchange">
</endpoint>
<endpoint address="net.pipe://localhost/EventPublishingServicePipe"
binding="netNamedPipeBinding" contract="EventService.Contracts.IEventPublishService"
listenUriMode="Explicit">
</endpoint>
<host>
</host>
</service>
クライアントエンドポイントについては、両方を試しました
<endpoint address="net.tcp://localhost:8524/EventPublishingService"
binding="netTcpBinding" bindingConfiguration="NetTcpBinding_IEventPublishService"
contract="AGX.Atlas.EventService.Contracts.IEventPublishService" name="NetTcpBinding_IEventPublishService">
</endpoint>
と
<endpoint address="net.pipe://localhost/EventPublishingServicePipe"
binding="netNamedPipeBinding" bindingConfiguration="NetNamedPipeBinding_IEventPublishService"
contract="AGX.Atlas.EventService.Contracts.IEventPublishService" name="NetNamedPipeBinding_IEventPublishService">
</endpoint>
クライアントバインディングを削除するときに、サービスからnet.pipeバインディングも削除して、それで奇妙なことをしていないことを確認しました。それでも同じ問題です。
バインディング構成は次のとおりです。
<netNamedPipeBinding>
<binding name="NetNamedPipeBinding_IEventPublishService" 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">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<security mode="Transport">
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netNamedPipeBinding>
<netTcpBinding>
<binding name="NetTcpBinding_IEventPublishService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
<binding name="NetTcpBinding_IEventSubscriptionService" closeTimeout="00:01:00"
openTimeout="00:01:00" receiveTimeout="00:10:00" sendTimeout="00:01:00"
transactionFlow="false" transferMode="Buffered" transactionProtocol="OleTransactions"
hostNameComparisonMode="StrongWildcard" listenBacklog="10"
maxBufferPoolSize="524288" maxBufferSize="65536" maxConnections="10"
maxReceivedMessageSize="65536">
<readerQuotas maxDepth="32" maxStringContentLength="8192" maxArrayLength="16384"
maxBytesPerRead="4096" maxNameTableCharCount="16384" />
<reliableSession ordered="true" inactivityTimeout="00:10:00"
enabled="false" />
<security mode="Transport">
<transport clientCredentialType="Windows" protectionLevel="EncryptAndSign" />
<message clientCredentialType="Windows" />
</security>
</binding>
</netTcpBinding>