Windows サービスでホストされている WCF とサービス GUI の間で通信しようとしています。問題は、取得している OperationContract メソッドを実行しようとしているときです
「コントラクト「IContract」を持つ「net.tcp://localhost:7771/MyService」の ChannelDispatcher は、その IChannelListener を開くことができません。
私の app.conf は次のようになります。
<configuration>
<system.serviceModel>
<bindings>
<netTcpBinding>
<binding name="netTcpBinding">
<security>
<transport protectionLevel="EncryptAndSign" />
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="MyServiceBehavior">
<serviceMetadata httpGetEnabled="true" httpGetUrl="http://localhost:7772/MyService" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service behaviorConfiguration="MyServiceBehavior"
name="MyService.Service">
<endpoint address="net.tcp://localhost:7771/MyService" binding="netTcpBinding"
bindingConfiguration="netTcpBinding" name="netTcp" contract="MyService.IContract" />
</service>
</services>
</system.serviceModel>
ポート 7771 はリッスンしており (netstat を使用してチェック)、svcutil は構成を生成できます。
任意の提案をいただければ幸いです。
例外からのスタック トレース
Server stack trace: at System.ServiceModel.Channels.ServiceChannel.ThrowIfFaultUnderstood(Message reply, MessageFault fault, String action, MessageVersion version, FaultConverter faultConverter) at System.ServiceModel.Channels.ServiceChannel.HandleReply(ProxyOperationRuntime operation, ProxyRpc& rpc) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs, TimeSpan timeout) at System.ServiceModel.Channels.ServiceChannel.Call(String action, Boolean oneway, ProxyOperationRuntime operation, Object[] ins, Object[] outs) at System.ServiceModel.Channels.ServiceChannelProxy.InvokeService(IMethodCallMessage methodCall, ProxyOperationRuntime operation) at System.ServiceModel.Channels.ServiceChannelProxy.Invoke(IMessage message)
内部例外が 1 つあります (ただし、Exeption.InnerExeption の下ではなく、Exeption.Detail.InnerExeption の下に - ToString() メソッドでは表示されません)。
URI 'net.tcp://localhost:7771/MyService' の登録は既に存在します。
しかし、私のサービスは、この URI を app.config ファイルでのみ指定しています。ソリューション全体で、この URI はサーバーに 1 回、クライアントに 1 回出現します。