2013-02-28 73 views
0

我在调用Windows Azure角色环境时出现此错误。 我检查了DotNetOpenAuth.OAuth.Common.dll为Copy Local = True。Windows Azure角色环境 - 无法找到程序集

有什么想法?

System.TypeInitializationException被抓住的HResult = -2146233036
消息=对的类型初始值 '' 引发了异常。
源= Microsoft.WindowsAzure.ServiceRuntime类型名=
堆栈跟踪: 在Microsoft.WindowsAzure.ServiceRuntime.RoleEnvironment.GetLocalResource(字符串 localResourceName) 在Platform.Services.Api.Common.FileStorage.GetFilePath(字符串 azureLocalResourceNameFromServiceDefinition,字符串blobContainer, String fileName)in d:\ TFS Project \ DEV \ Platform \ Platform.Development \ Platform.Services.Api \ Common \ FileStorage.cs:line at Platform.Services.Api.Controllers.ReportingController.PrintProcessInteraction (Int64 id)in d:\ TFS Project \ DEV \ Platform \ Platform.Dev消息=在尝试初始化默认appdomain时,C++模块加载失败。如果您尝试初始化默认appdomain,则C++模块将无法加载。

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

的errorMessage,异常的InnerException) 在.LanguageSupport.Initialize(LanguageSupport * ) 在.cctor() 的InnerException:System.Runtime.Serialization.SerializationException 的HResult = -2146233076 消息=无法找到'DotNetOpenAuth.OAuth.Common,Version = 4.2.0.0,Culture = neutral, 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(字符串 对象名,字符串[] memberNames,BinaryTypeEnum [] binaryTypeEnumA, 对象[] typeInformationA,的Int32 [] memberAssemIds,objectReader objectReader,的Int32的ObjectID ,BinaryAssemblyInfo assemblyInfo, SizedArray assemIdToAssemblyTable) at System.Runtime.Serialization.Formatt ers.Binary._ BinaryParser.ReadObjectWithMapTyped(BinaryObjectWithMapTyped record) at System.Runtime.Serialization.Formatters.Binary。 _BinaryParser.Run() 在System.Runtime.Serialization.Formatters.Binary.ObjectReader.Deserialize(HeaderHandler 处理程序,__BinaryParser serParser,布尔FCHECK,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage) 在System.Runtime.Serialization.Formatters.Binary .BinaryFormatter.Deserialize(Stream serializationStream,HeaderHandler处理程序,布尔fCheck,布尔 isCrossAppDomain,IMethodCallMessage methodCallMessage) at 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(即时聊天 reqMsg,即时聊天retMsg) 在System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData & MSGDATA,的Int32类型) 在System.AppDomain.get_Id() 在.DoCallBackInDefaultDomain(IntPtr的功能, 无效*饼干) 在.DefaultDomain.Initialize() 在.LanguageSupport.InitializeDefaultAppDomain(LanguageSupport * ) 在.LanguageSupport._Initialize(LanguageSupport * ) 在.LanguageSupport.Initialize(LanguageSupport * ) 的InnerException:

+0

这与DotNetOpenAuth有什么关系?我在错误的任何地方都看不到它。 – 2013-03-01 17:00:39

回答

0

Windows Azure Runtime正在做一些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 
-1

确保您编译到x64或任何CPU?

+0

“任何CPU”...我已将它更改为x64,但没有成功。 – 2013-02-28 17:56:06