【问题标题】:Windows Azure Role Environment - Unable to find assemblyWindows Azure 角色环境 - 找不到程序集
【发布时间】:2013-02-14 22:47:55
【问题描述】:

我在调用 Windows Azure 角色环境时收到此错误。 我检查了 DotNetOpenAuth.OAuth.Common.dll 作为 Copy Local = True。

有什么想法吗?

System.TypeInitializationException 被捕获 HResult=-2146233036
Message='' 的类型初始值设定项引发了异常。
源=Microsoft.WindowsAzure.ServiceRuntime 类型名称=
堆栈跟踪: 在 Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource(字符串 本地资源名称) 在 Platform.Services.Api.Common.FileStorage.GetFilePath(字符串 azureLocalResourceNameFromServiceDefinition,字符串 blobContainer, d:\TFS 中的字符串文件名) Project\DEV\Platform\Platform.Development\Platform.Services.Api\Common\FileStorage.cs:line 16 在 Platform.Services.Api.Controllers.ReportingController.PrintProcessInteraction(Int64 id) 在 d:\TFS Project\DEV\Platform\Platform.Development\Platform.Services.Api\Controllers\ReportingController.cs:line 217 内部异常:.ModuleLoadException H结果=-2146233088 Message=C++ 模块在尝试初始化默认应用程序域时加载失败。

   Source=msshrtmi
   StackTrace:
        at <CrtImplementationDetails>.ThrowModuleLoadException(String

errorMessage, 异常innerException) 在 .LanguageSupport.Initialize(LanguageSupport* ) 在 .cctor() 内部异常:System.Runtime.Serialization.SerializationException H结果=-2146233076 消息=找不到程序集“DotNetOpenAuth.OAuth.Common,版本=4.2.0.0,文化=中性, PublicKeyToken=2780ccd10d57b246'。 源=mscorlib 堆栈跟踪: 服务器堆栈跟踪: 在 System.Runtime.Serialization.Formatters.Binary.BinaryAssemblyInfo.GetAssembly() 在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo 装配信息,字符串名称) 在 System.Runtime.Serialization.Formatters.Binary.ObjectMap..ctor(字符串 objectName, String[] memberNames, BinaryTypeEnum[] binaryTypeEnumA, Object[] typeInformationA, Int32[] memberAssemIds, ObjectReader objectReader, Int32 objectId, BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) 在 System.Runtime.Serialization.Formatters.Binary._BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped 记录) 在 System.Runtime.Serialization.Formatters.Binary。_BinaryParser.Run() 在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler 处理程序,__BinaryParser serParser,布尔 fCheck,布尔 isCrossAppDomain, IMethodCallMessage 方法CallMessage) 在 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(流 serializationStream, HeaderHandler 处理程序, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage 方法CallMessage) 在 System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm) 在 System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain() 在 System.Runtime.Remoting.Channels.CrossAppDomainSink.DoDispatch(字节 [] reqStmBuff, SmuggledMethodCallMessage smuggledMcm, SmuggledMethodReturnMessage& smuggledMrm) 在 System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(对象 [] 参数) 在 [0] 处重新抛出异常: 在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 在 System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(消息数据& msgData,Int32 类型) 在 System.AppDomain.get_Id() 在 .DoCallBackInDefaultDomain(IntPtr 函数, 无效* cookie) 在 .DefaultDomain.Initialize() 在 .LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) 在 .LanguageSupport._Initialize(LanguageSupport* ) 在 .LanguageSupport.Initialize(LanguageSupport* ) 内部异常:

【问题讨论】:

  • 这与 DotNetOpenAuth 有什么关系?我在错误的任何地方都没有看到它。

标签: azure dotnetopenauth azure-role-environment


【解决方案1】:

Windows Azure 运行时正在使用 DotNetOpenAuth(我不知道为什么……这看起来很奇怪)。为了解决这个问题,我创建了一个启动任务,将 DotNetOpenAuth.OAuth.Common.dll 安装到 GAC (following this solution)。

type .\GACUtils\DotNetOpenAuth.OAuth.Common.dll
type .\GACUtils\gacutil 
.\GACUtils\gacutil /nologo /i .\GACUtils\DotNetOpenAuth.OAuth.Common.dll 

exit /b 0

【讨论】:

    【解决方案2】:

    确保编译到 x64 或任何 CPU?

    【讨论】:

    • "Any CPU"...我已将其更改为 x64 但没有成功。
    猜你喜欢
    • 1970-01-01
    • 2012-05-05
    • 1970-01-01
    • 2014-07-30
    • 2013-07-01
    • 1970-01-01
    • 1970-01-01
    • 2016-04-23
    • 1970-01-01
    相关资源
    最近更新 更多