2013-01-04 5 views
0

작업자 역할을 사용하여 웹 역할에 데이터를 제공하고 웹 역할과 웹 역할 간의 격리를 유지하기 위해 내부 끝점을 통해 작업자 역할에 연결된 Azure 웹 역할이 있습니다. 민감한 데이터가 포함 된 데이터베이스 작업자 역할과 웹 역할 모두에서 참조하는 모든 필요한 데이터 계약을 포함하는 클래스 라이브러리 프로젝트가 있습니다.공유 된 DataContract 작업자 역할/웹 역할

개발 환경에서 모든 것이 좋으며 치료가 효과적입니다. Azure에 업로드하자마자 작업자 역할이 시작되지 않습니다. 오류 메시지 :

Message string Failed with ExceptionSystem.IO.FileNotFoundException: Could not load file or assembly 'ReadOnly_DC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' or one of its dependencies. The system cannot find the file specified. 
File name: 'ReadOnly_DC, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null' 
    at System.Signature.GetSignature(SignatureStruct& signature, Void* pCorSig, Int32 cCorSig, RuntimeFieldHandleInternal fieldHandle, IRuntimeMethodInfo methodHandle, RuntimeType declaringType) 
    at System.Reflection.RuntimeMethodInfo.get_Signature() 
    at System.Reflection.RuntimeMethodInfo.GetParameters() 
    at System.ServiceModel.Description.ServiceReflector.ValidateParameterMetadata(MethodInfo methodInfo) 
    at System.ServiceModel.Description.TypeLoader.CreateOperationDescriptions(ContractDescription contractDescription, ContractReflectionInfo reflectionInfo, Type contractToGetMethodsFrom, ContractDescription declaringContract, MessageDirection direction) 
    at System.ServiceModel.Description.TypeLoader.CreateContractDescription(ServiceContractAttribute contractAttr, Type contractType, Type serviceType, ContractReflectionInfo& reflectionInfo, Object serviceImplementation) 
    at System.ServiceModel.Description.TypeLoader.LoadContractDescriptionHelper(Type contractType, Type serviceType, Object serviceImplementation) 
    at System.ServiceModel.Description.ContractDescription.GetContract(Type contractType, Type serviceType) 
    at System.ServiceModel.ServiceHost.CreateDescription(IDictionary`2& implementedContracts) 
    at System.ServiceModel.ServiceHostBase.InitializeDescription(UriSchemeKeyedCollection baseAddresses) 
    at System.ServiceModel.ServiceHost..ctor(Type serviceType, Uri[] baseAddresses) 
    at DA_Worker.WorkerRole.StartWS_Host() in C:\Users\grant.roy\Documents\Visual Studio 2010\Projects\CraigAzure\DA_Worker\WorkerRole.cs:line 80 

WRN: Assembly binding logging is turned OFF. 
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1. 
Note: There is some performance penalty associated with assembly bind failure logging. 
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog]. 
; TraceSource 'WaWorkerHost.exe' event 

데이터 계약 클래스 라이브러리 "ReadOnly_DC"를 열 수없는 것으로 보입니다.

ReadOnly_DC에 대한 참조가 로컬 복사로 설정되어 있고 데이터 계약 클래스 라이브러리와 함께 사용하지 않는 모든 참조에서 "로컬 복사"를 시도했습니다.

감사하게 생각하는 제안이 있습니다.

답변

0

오케이 -이 답변을 믿을 수 없지만 이것이 어떻게 작동하는지입니다. 다양한 클래스 라이브러리의 모든 로직을 직접 내 Worker Role 프로젝트로 옮겼습니다. 그러면 놀랍지 않게 다양한 방법과 데이터 계약이 필요하고 Worker Role이 시작되었습니다.

"공유"리소스를 웹 역할과 공유하기 위해 솔루션 탐색기에서 "기존 항목 추가"기능을 통해 [데이터 계약, YubiKey- 클래스 및 IWebService 자체]를 웹 역할에 추가했습니다. 파일을 복제하는 대신 "링크"로 추가하십시오.

이렇게하면 인터넷에 노출 된 내 웹 역할에서 내 [숨겨진] 워커 역할에있는 모든 비밀 정보 [연결 문자열 및 공유 된 저장소 액세스 키]가 분리되어 유지됩니다.

0

그랜트는 클래스 라이브러리가 선택되어 있는지 확인합니다 "프로젝트 종속성 ..."당신이 바로 솔루션 탐색기에서 작업자 역할 프로젝트를 클릭합니다.

+0

데이터 계약 클래스 라이브러리가 종속성으로 설정되었지만 종속성으로 설정하는 것을 잊어 버린 유비 키 (보안 토큰) 클래스 라이브러리가 있습니다. 나는 그것을 지금하고 현재 재 출판한다. - 고마워요. –

관련 문제