Windows 서비스 내에 WCF 서비스를 작성 했으므로 어떤 이유로 인해 여러 시스템에 서비스가 배포되지 않았습니다. (모두 OS 및 구성에서 거의 동일 함), 모든 서버에서 작동합니다. 모든 배포에 대한 구성은 서비스의 기본 주소를 제외하고 동일합니다.WCF (net.tcp) 서비스 : 하나의 시스템을 제외한 모든 시스템에서 작동
서비스가 시작될 때 ServiceHost
을 열어도 예외가 없으며 netstat -anp
을 사용하면 서비스 프로세스에서 소켓을 열어 볼 수 있습니다. 삭제 된 패킷에 대한 Windows 방화벽 로깅을 설정했지만 로그 파일은 비어 있습니다.
나는 WCF 테스트 클라이언트에서 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.
을하지만, 로그 파일도 생성되지 않습니다.
<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>
내가 좀 잃었어요, NO 표시가 왜 작동하지 않습니다에 관해서는 전혀 없기 때문에 다음과 같이
서비스에 대한 설정입니다. 어떤 도움을 주시면 감사하겠습니다.
포트가 올바른 프로세스에서만 사용되는지 확인했습니다. .NET은 모든 컴퓨터에 설치된 버전 4입니다. 타사 DLL은 사용되지 않습니다. 유일한 방화벽은 사용 된 TCP 포트에 대한 예외가있는 Windows 방화벽입니다. 모든 배포는 동일한 .msi에서 수행되었으며 파일은 동일합니다. – ErikHeemskerk
고정되어 있으며 내 부분에서 어리석은 실수였습니다. 포트를 변경하려고 시도한 다음 포트가 변경되지 않았 음을'netstat -ano' 명령으로 알았습니다. 그런 다음 잘못된 구성 파일을 편집하고있는 것으로 나타났습니다. 포인터 주셔서 감사! – ErikHeemskerk
헤이 데이비드, 나는 똑같은 문제가 있다고 생각하고 당신이 말한 것을 시도했지만 didnt 일 ... 당신이 나를 도울 수 있습니까? 다음은 관련 질문입니다. ** [Question] (http : // stackoverflow.com/questions/9273340/cant-test-net-tcp-service-in-wcftestclient # comment11690979_9273340) ** – Joze