2009-12-17 2 views
11

저는 fx3.5에서 WCF를 사용하여 JSONP 웹 서비스를 배우고 구축했습니다. 당신은 내가 가지고 있었던 시련의 일부를 읽을 수 있습니다 .NET ASMX - Returning Pure JSON? 마침내 샘플을 실행하고 있지만 지금은 내 애플 리케이션으로 꼬리 도덕이다.확장명 '[extensionHere]'에 등록 된 [nameHere] 유형을로드 할 수 없습니다.

서비스의 Web.config :

<system.serviceModel> 
    <behaviors> 
     <endpointBehaviors> 
     <behavior name="JsonpServiceBehavior"> 
      <webHttp /> 
     </behavior> 
     </endpointBehaviors> 
    </behaviors> 
    <services> 
     <service name="RivWorks.Web.Service.CustomerService"> 
     <endpoint address="" 
        binding="customBinding" 
        bindingConfiguration="jsonpBinding" 
        behaviorConfiguration="JsonpServiceBehavior" 
        contract="RivWorks.Web.Service.ICustomerService" /> 
     </service> 
     <service name="RivWorks.Web.Service.NegotiateService"> 
      <endpoint address="" 
        binding="customBinding" 
        bindingConfiguration="jsonpBinding" 
        behaviorConfiguration="JsonpServiceBehavior" 
        contract="RivWorks.Web.Service.INegotiateService" /> 
     </service> 
    </services> 
    <bindings> 
     <customBinding> 
     <binding name="jsonpBinding" > 
      <jsonpMessageEncoding /> 
      <httpTransport manualAddressing="true"/> 
     </binding> 
     </customBinding> 
    </bindings>  
    <extensions> 
     <bindingElementExtensions> 
     <add name="jsonpMessageEncoding" 
      type="RivWorks.Web.Service.JSONP.JsonpBindingExtension 
       , RivWorks.Web.Service 
       , Version=1.0.0.0 
       , Culture=neutral 
       , PublicKeyToken=null"/> 
     </bindingElementExtensions> 
    </extensions> 
    </system.serviceModel> 

나는 다음과 같은 오류가 발생하고 있고 나는 그것을 해결하는 생각할 수있는 모든 노력을했습니다. 내 코드 전체에 몇 가지 오타가 있음을 발견했습니다 (서비스 대신 Sevice). MSDN에있는 샘플 코드를 사용하고 있습니다. 여기에 오류가 있습니다 :

Configuration Error Description:** An error occurred during the processing of a configuration file required to service this request. Please review the specific error details below and modify your configuration file appropriately. 

Parser Error Message: The type 'RivWorks.Web.Service.JSONP.JsonpBindingExtension 
       , RivWorks.Web.Service 
       , Version=1.0.0.0 
       , Culture=neutral 
       , PublicKeyToken=null' registered for extension 'jsonpMessageEncoding' could not be loaded. 

Source Error: 

Line 58: <customBinding> 
Line 59:  <binding name="jsonpBinding"> 
Line 60:   <jsonpMessageEncoding /> 
Line 61:   <httpTransport manualAddressing="true" /> 
Line 62:  <binding> 

Source File: C:\RivWorks\dev\services\web.config Line: 60 

Version Information: Microsoft .NET Framework Version:2.0.50727.3603; ASP.NET Version:2.0.50727.3082 

다른 사람이 내가 확인할 수있는 아이디어가 있습니까? RivWorks.Web.Service.dll이라는 DLL이 만들어져 웹 사이트의 bin 디렉토리에 복사됩니다. Web.config 서비스가 웹 사이트의 Services 디렉터리에 복사됩니다. 웹 사이트의 web.config에 상충되는 내용이 없습니다. 모든 철자 문제를 점검했습니다.

+0

이것은 공식적인 대답은 아니지만이 정확한 문제에 대한 좌절감을 공유하고자합니다. IIS에서 응용 프로그램 A (App_A)를 호스팅하는 사이트 A가 있습니다. 그런 다음 사이트 A 아래에 응용 프로그램 B (App_B)를 호스팅하는 가상 디렉터리가 있습니다. App_A는 위와 유사한 사용자 정의 확장을 구현합니다. App_B의 web.config는 App_A의 web.config에서이 사용자 지정 확장을 상속 받았습니다. 이것은 여기에 설명 된 정확한 오류를 던지고있었습니다. 이것은 올바르게 설정하지 않으면 완전히 잘못되었다. 나는 그걸 모든 사람과 공유하고 싶었습니다. 가치있는 대답인지 확실하지 않습니다. – dyslexicanaboko

답변

15

빌드 결과에 dll (RivWorks.Web.Service.dll)이 있습니까?

다음으로, (이하 "jsonpMessageEncoding"연장) 시도 :

type="RivWorks.Web.Service.JSONP.JsonpBindingExtension, RivWorks.Web.Service, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null" 

주에게 서로 다른 간격을 모두 " , " 및 캐리지 리턴의 관점에서.

그 후, 나는이 문자열을 고음으로 검사 할 것입니다. 당신이 필요로하는 DLL (RivWorks.Web.Service),과 출력을 참조하는 콘솔 EXE 쓰기 :

그대로, 당신이 XML에서 원하는 문자열입니다
Console.WriteLine(
    typeof(RivWorks.Web.Service.JSONP.JsonpBindingExtension) 
    .AssemblyQualifiedName); 

. 이 문자열에 여분의 공백을 포함하지 마십시오.

+0

콘솔 앱을 실행하면 문자열이 그대로 유지됩니다. 문자열 var에서 그것을 캡쳐하고, 그것을 검사하고, 복사하고, 그것을 내 서비스 web.config에 붙여 넣었지만 여전히 같은 오류입니다. 다른 생각들? –

+0

그리고 DLL은 빌드 출력에 있습니다. BeyondCompare를 사용하여 로컬 컴퓨터 프로젝트 영역에서 localhost 디렉토리로 이동합니다. 또한 BeaveCompare를 통해 Dev 서버의 Dev 디렉토리로 이동합니다. 각 단계를 확인하고 매번 최신 빌드를 볼 수 있습니다. –

+0

당신이 보여 주듯이 한 줄에 모든 것을 가져다 봤는데 아무런 차이가 없었습니다. : –

관련 문제