2013-02-28 59 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