2012-03-14 3 views
1

VS2010에서 WCF 응용 프로그램을 개발 중입니다. in-IDE 디버거를 사용하여 호스트 응용 프로그램과 클라이언트를 실행하면 모든 것이 의도 한대로 작동합니다. 내가 수동으로 두 개의 실행 파일을 실행할 때WCF SocketException

그러나, (은/빈/디버그/폴더로 이동), I는 클라이언트에서 다음 예외가 :

System.Net.Sockets.SocketException을 : 없음 연결이있을 수 있습니다 대상 컴퓨터가 적극적으로 127.0.0.1:8732

을 거부했기 때문에 이상한 일이의 app.config 파일에 내가 8732.

무슨 일이야, 포트 5000를 사용하지 않도록 지정 해요되어 만들어진? 미리 감사드립니다.

편집 :

<?xml version="1.0" encoding="utf-8" ?> 
<configuration> 

    <system.web> 
    <compilation debug="true" /> 
    </system.web> 
    <!-- When deploying the service library project, the content of the config file must be added to the host's 
    app.config file. System.Configuration does not support config files for libraries. --> 
    <system.serviceModel> 
    <services> 
     <service name="WCFServiceLibrary.SavalotServiceObject"> 
     <endpoint address="" binding="wsHttpBinding" contract="WCFServiceLibrary.ISavalotService"> 
      <identity> 
      <dns value="localhost" /> 
      </identity> 
     </endpoint> 
     <endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" /> 
     <host> 
      <baseAddresses> 
      <add baseAddress="http://localhost:5000/Design_Time_Addresses/WCFServiceLibrary/SavalotServiceObject/" /> 
      </baseAddresses> 
     </host> 
     </service> 
    </services> 
    <behaviors> 
     <serviceBehaviors> 
     <behavior> 
      <!-- To avoid disclosing metadata information, 
      set the value below to false and remove the metadata endpoint above before deployment --> 
      <serviceMetadata httpGetEnabled="True"/> 
      <!-- To receive exception details in faults for debugging purposes, 
      set the value below to true. Set to false before deployment 
      to avoid disclosing exception information --> 
      <serviceDebug includeExceptionDetailInFaults="False" /> 
     </behavior> 
     </serviceBehaviors> 
    </behaviors> 
    </system.serviceModel> 

</configuration> 
+2

ctrl + F5를 눌러 디버깅하지 않고 실행하면 어떻게됩니까? – deltree

+0

@deltree 같은 오류입니다. – Xenoprimate

+1

그러면 문제는 설정 파일에 디버그 설정이 있다는 것입니다. – deltree

답변

4

사용자가 13 코멘트이 경우

를 통해 갈 필요가 없습니다 SO 배치하는 문제는 사용자가 멀티 프로젝트 솔루션을 실행 한 것이 었습니다. 이 경우 어떤 프로젝트가 실행 중인지는 설정 파일이 중요한 프로젝트입니다.

WcfService가 인 경우 서비스가 포함 된 프로젝트에 web.config 파일이 올바른 포트를 사용하도록 구성되어 있어야합니다.

WcfService를으로 테스트하는 경우 테스트 프로젝트에서 올바른 포트를 사용하도록 app.config 파일을 구성해야합니다.

이것은 webservices의 새로운 기능이며 일반적으로 부끄러워 할 일이없는 일반적인 오류입니다.

0

당신이 WireShark 같은 것을 사용하여 시도 유무 : 여기에 호스트 응용 프로그램에 대한의 app.config입니까? 양쪽 끝점에서 실행하면 소켓 문제를 해결하는 좋은 방법입니다.

관련 문제