WindowsサービスのWCFサービスに関するビデオtutorialを参照すると、サンプルWCFサービスが作成され、WindowsサービスのnetTcpBindingでそのサービスがホストされています。 (私はこのWCFサービスをWindowsサービスとして実行したいので)net.tcp:// localhost ...に接続できませんでしたTCPエラーコード10061
これは、従業員の詳細を追加/削除/読み込みし、Windowsフォームアプリケーションで消費されるシンプルなサービスです。私のクライアントがソリューションのプロジェクトを直接参照していないことを確認したいとき、私は両方のサービス(wcf + windows)を私のソリューションから除外しました。それはエラーをスローする作業を停止しました:
net.tcp:// localhost:8010/EmployeeService.Service1 /に接続できませんでした。接続の試行は、00:00:02.0180000の時間間隔で続きました。 TCPエラーコード10061:ターゲットマシンが積極的に127.0.0.1:8010を拒否したため、接続できませんでした。答えるために役立つかもしれない
重要ポイント:
- WCFサービスとWindowsサービスの同一のapp.configを持って
- Windowsサービスは、これは私のクライアントアプリですサービス
として実行されています.config
<?xml version="1.0" encoding="utf-8" ?>
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="netTcpEndPoint" 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>
</bindings>
<client>
<endpoint address="net.tcp://localhost:8010/EmployeeService.Service1/"
binding="netTcpBinding" bindingConfiguration="netTcpEndPoint"
contract="Service1.IService1" name="netTcpEndPoint">
<identity>
<userPrincipalName value="[email protected]" />
</identity>
</endpoint>
</client>
</system.serviceModel>
</configuration>
いただければ幸いです....答え自分自身が見つかり