IIS 8.5에서 실행되는 WCF 서비스가 있습니다. Windows Forms 프로젝트 및 콘솔 응용 프로그램 프로젝트에서 서비스를 사용하고 테스트했으며 정상적으로 작동합니다. 하지만 비주얼 스튜디오에서 ServiceModel은 서비스 클라이언트 구성 섹션에서 계약 'bindSignalR.bindSinalRService'을 참조 2013클래스 라이브러리 응용 프로그램에서 WCF 서비스를 사용할 수 없습니다.
찾을 수 없습니다 기본 끝점 요소를 클래스 라이브러리 프로젝트에서 웹 서비스를 소비 할 수 없습니다입니다. 이는 응용 프로그램에 대한 구성 파일이 없거나이 계약에 일치하는 엔드 포인트 요소가 클라이언트 요소에 없기 때. 일 수 있습니다.
Windows Forms Project (작동하는) 및 클래스 라이브러리 프로젝트의 구성 파일을 조사했지만 차이점을 찾을 수 없습니다. 내가 도대체 뭘 잘못하고있는 겁니까?
서비스의의 Web.config은 다음과 같습니다
<configuration>
<system.web>
<compilation targetFramework="4.0" />
</system.web>
<system.serviceModel>
<behaviors>
<serviceBehaviors>
<behavior name="">
<serviceMetadata httpGetEnabled="true" />
<serviceDebug includeExceptionDetailInFaults="true" />
</behavior>
</serviceBehaviors>
</behaviors>
<bindings>
<customBinding>
<binding name="bindSignalRService.Web.bindSinalRService.customBinding0">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<serviceHostingEnvironment aspNetCompatibilityEnabled="true"
multipleSiteBindingsEnabled="true" />
<services>
<service name="bindSignalRService.Web.bindSinalRService">
<endpoint address="" binding="customBinding" bindingConfiguration="bindSignalRService.Web.bindSinalRService.customBinding0"
contract="bindSignalRService.Web.bindSinalRService" />
<endpoint address="mex" binding="mexHttpBinding" contract="IMetadataExchange" />
</service>
</services>
</system.serviceModel>
</configuration>
윈도우 형태로의 app.config (이 잘 작동!) 응용 프로그램 :
<configuration>
<configSections>
</configSections>
<system.serviceModel>
<bindings>
<customBinding>
<binding name="CustomBinding_bindSinalRService">
<binaryMessageEncoding />
<httpTransport />
</binding>
</customBinding>
</bindings>
<client>
<endpoint address="http://slascvm042:49904/bindSinalRService.svc"
binding="customBinding" bindingConfiguration="CustomBinding_bindSinalRService"
contract="bindNewEventService.bindSinalRService" name="CustomBinding_bindSinalRService" />
</client>
</system.serviceModel>
</configuration>
하지만 소비 할 때 클래스 라이브러리 응용 프로그램의 WCF 서비스 오류가 발생했습니다. ServiceModel 클라이언트 구성 섹션에서 계약 'bindSignalR.bindSinalRService'를 참조하는 기본 끝점 요소를 찾을 수 없습니다. 이는 응용 프로그램에 대한 구성 파일이 없거나이 계약에 일치하는 엔드 포인트 요소가 클라이언트 요소에 없기 때. 일 수 있습니다.
내가 점점 오전 오류가 굵게 및 중앙의 하나입니다. –
어떤 상황에서 오류가 발생합니까? 나는 네가 예외가 있다는 것을 의미한다고 믿는다. 스택 추적 및 내부 예외를 포함하여 전체 예외를 게시하십시오. 문제 해결을 위해이 작업을 수행하는 간단한 방법은 예외를 잡아 내고'ex.ToString()'의 결과를 게시하는 것입니다. –
클래스 라이브러리를 호스팅하는 프로세스는 무엇입니까? 라이브러리를 호스팅하는 앱의 구성이 위의 구성으로 업데이트되지 않은 것 같습니다. –