2012-04-20 21 views
0

我的web應用程序。如果我試圖讀取使用RoleEnvironment.GetConfigurationSettingValue(「發送者名稱」)從ServiceConfig什麼 我收到錯誤有關Microsoft.IdentityModel使用MVC3剃刀錯誤使用RoleEnvironment獲得配置

Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Runtime.Serialization.SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'. 

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below. 

Stack Trace: 


[SerializationException: Unable to find assembly 'Microsoft.IdentityModel, Version=3.5.0.0, Culture=neutral, PublicKeyToken=31bf3856ad364e35'.] 
    System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg) +4727747 
    System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type) +1725 
    System.AppDomain.get_Id() +0 
    <CrtImplementationDetails>.DoCallBackInDefaultDomain(IntPtr function, Void* cookie) +185 
    <CrtImplementationDetails>.LanguageSupport._Initialize(LanguageSupport*) +328 
    <CrtImplementationDetails>.LanguageSupport.Initialize(LanguageSupport*) +102 

[ModuleLoadException: The C++ module failed to load while attempting to initialize the default appdomain. 
] 

確實,我正在使用Windows身份驗證基礎進行Azure acs身份驗證。但是,當我部署到Azure時,一切正常。但是,如果我使用RoleEnvironment從ServiceConfig文件讀取任何設置(例如:RoleEnvironment .GetConfigurationSettingValue(「Smtpserver」))。它在Azure上失敗。

但是,我的本地天青appfabric一切工作正常。如果我刪除這行代碼,那麼所有的工作都很好。 RoleEnvironment.GetConfigurationSettingValue("Smtpserver")) 我在我的雲應用程序中使用了兩個卷軸。 請幫我找出錯誤原因

回答

0

你是怎麼在Azure上安裝WIF的?

最可靠的方法是通過啓動任務安裝WIF運行時。你退房this question here。我認爲this one是完全重複的。

+0

僅當我嘗試從ServiceConfig讀取設置時才發現此錯誤。否則一切正常。 – amazing 2012-04-20 05:24:18

+0

你是否徹底檢查了參考問題和他們的答案? – astaykov 2012-04-20 05:44:24

+0

如果我遠離我的天藍色卷軸,我可以看到WIF安裝。 – amazing 2012-04-20 06:43:23