我在调用 Windows Azure 角色环境时收到此错误。我检查了 DotNetOpenAuth.OAuth.Common.dll 作为 Copy Local = True。
任何想法?
System.TypeInitializationException 被捕获 HResult=-2146233036
Message='' 的类型初始化程序引发了异常。
源=Microsoft.WindowsAzure.ServiceRuntime 类型名称=
StackTrace:在 Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource(String localResourceName) 在 Platform.Services.Api.Common.FileStorage.GetFilePath(String azureLocalResourceNameFromServiceDefinition, String blobContainer, String fileName) 在 d:\TFS Project\DEV\Platform\Platform .Development\Platform.Services.Api\Common\FileStorage.cs:D:\TFS Project\DEV\Platform\Platform.Development\Platform 中 Platform.Services.Api.Controllers.ReportingController.PrintProcessInteraction(Int64 id) 的第 16 行。 Services.Api\Controllers\ReportingController.cs:line 217 InnerException: .ModuleLoadException HResult=-2146233088 Message=C++ 模块在尝试初始化默认应用程序域时加载失败。Source=msshrtmi StackTrace: at <CrtImplementationDetails>.ThrowModuleLoadException(String
errorMessage, Exception innerException) at .LanguageSupport.Initialize(LanguageSupport* ) at .cctor() InnerException: System.Runtime.Serialization.SerializationException HResult=-2146233076 Message=Unable to find assembly 'DotNetOpenAuth.OAuth.Common, Version=4.2.0.0 ,文化=中性,PublicKeyToken=2780ccd10d57b246'。Source=mscorlib StackTrace:服务器堆栈跟踪:在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.GetType(BinaryAssemblyInfo assemblyInfo, String name) 在 System.Runtime. .Serialization.Formatters.Binary.ObjectMap..ctor(String objectName, String[] memberNames,System.Runtime.Serialization.Formatters.Binary 处的 BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped 记录)。_BinaryParser.Run() 在 System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler handler, __BinaryParser serParser, Boolean fCheck, Boolean isCrossAppDomain, IMethodCallMessage methodCallMessage) 在 System.Runtime.Serialization.Formatters.Binary.BinaryFormatter.Deserialize(在 System.Runtime.Remoting.Channels.CrossAppDomainSerializer.DeserializeObject(MemoryStream stm) 在 System.Runtime.Remoting.Messaging.SmuggledMethodCallMessage.FixupForNewAppDomain() 的流序列化流,HeaderHandler 处理程序,布尔 fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage)。 Remoting.Channels.CrossAppDomainSink.DoDispatch(Byte[] reqStmBuff, SmuggledMethodCallMessage smuggledMcm,SmuggledMethodReturnMessage& smuggledMrm) 在 System.Runtime.Remoting.Channels.CrossAppDomainSink.DoTransitionDispatchCallback(Object[] args) 在 [0] 处重新抛出异常:在 System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) 在 System. Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) at System.AppDomain.get_Id() at .DoCallBackInDefaultDomain(IntPtr function, Void* cookie) at .DefaultDomain.Initialize() at .LanguageSupport.InitializeDefaultAppDomain(LanguageSupport* ) 在 .LanguageSupport._Initialize(LanguageSupport* ) 在 .LanguageSupport。初始化(语言支持*)内部异常: