我有一个 Azure Web 角色通过内部端点链接到工作角色,目的是使用工作角色向 Web 角色提供数据,保持 Web 角色和数据库 [包含敏感数据] 之间的隔离。有一个类库项目,其中包含工作角色和 Web 角色都引用的所有必要数据协定。
在开发环境中,一切都很好,而且效果很好。一旦我上传到 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 的引用设置为复制本地,我已尝试对与数据协定类库一起使用的所有引用“复制本地”,但无济于事。
任何建议都非常感谢!
授予