私はWindowsサービス内にWCFサービスを作成しましたが、何らかの理由でサービスを多数のシステム(OSと構成はほぼ同じ)に展開しましたが、1つを除いてすべてで機能します。サーバ。すべてのデプロイメントの構成は、サービスのベースアドレスを除いて同じです。
サービスを開始すると、を開いても例外は発生しません。ServiceHost
使用netstat -anp
すると、サービスのプロセスによってソケットが開かれたことがわかります。ドロップされたパケットのWindowsファイアウォールログを設定しましたが、ログファイルは空のままです。
WCFテストクライアントからWCFサービスにアクセスしようとすると、次のメッセージが表示されます。
Error: Cannot obtain Metadata from net.tcp://myhostname:9001/SysMonitorAgent
If this is a Windows (R) Communication Foundation service to which you have access, please check that you have enabled metadata publishing at the specified address. For help enabling metadata publishing, please refer to the MSDN documentation at http://go.microsoft.com/fwlink/?LinkId=65455.
WS-Metadata Exchange Error
URI: net.tcp://myhostname:9001/SysMonitorAgent
Metadata contains a reference that cannot be resolved: 'net.tcp://myhostname:9001/SysMonitorAgent'.
There was no endpoint listening at net.tcp://myhostname:9001/SysMonitorAgent that could accept the message. This is often caused by an incorrect address or SOAP action. See InnerException, if present, for more details.
WCFログを試しましたが、ログファイルが作成されません。
サービスの構成は次のとおりです。
<system.serviceModel>
<diagnostics>
<messageLogging logMalformedMessages="true" logMessagesAtServiceLevel="true" logMessagesAtTransportLevel="true" />
</diagnostics>
<bindings>
<netTcpBinding>
<binding name="InterfaceServiceNetTcpBinding">
<security mode="None">
<transport clientCredentialType="None" protectionLevel="None" />
<message clientCredentialType="None" />
</security>
</binding>
</netTcpBinding>
</bindings>
<behaviors>
<serviceBehaviors>
<behavior name="InterfaceServiceBehavior">
<serviceMetadata httpGetEnabled="false" />
<serviceDebug httpHelpPageEnabled="false" httpsHelpPageEnabled="false" includeExceptionDetailInFaults="false" />
</behavior>
</serviceBehaviors>
</behaviors>
<services>
<service name="SysMonitor.Agent.Interface.InterfaceService" behaviorConfiguration="InterfaceServiceBehavior">
<endpoint address="" binding="netTcpBinding" bindingConfiguration="InterfaceServiceNetTcpBinding" contract="SysMonitor.Agent.Interface.IInterfaceService">
<identity>
<dns value="localhost" />
</identity>
</endpoint>
<endpoint address="mex" binding="mexTcpBinding" contract="IMetadataExchange" />
<host>
<baseAddresses>
<add baseAddress="net.tcp://myhostname:9001/SysMonitorAgent" />
</baseAddresses>
</host>
</service>
</services>
</system.serviceModel>
なぜそれが機能しないのかについては何の兆候もないので、私はちょっと迷っています。どんな助けでもいただければ幸いです。