我有一個簡單的.net應用程序,它使用IIS 7.5中的.NET 2.0運行時,我已更改web.config中的計算機密鑰以使用以下內容:無法驗證數據錯誤,並將機器密鑰設置爲SHA1
<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="SHA1"/>
這適用於本地,但是當我發佈到服務器時,我收到一個「HttpException(0x80004005):無法驗證數據」每當瀏覽網站。我已經確保設置編譯debug =「false」。將驗證方法設置爲3DES可消除此問題,但我們需要使用SHA1。有沒有我在這裏失蹤的配置選項?請參閱下面的堆棧跟蹤。
[HttpException (0x80004005): Unable to validate data.]
System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo, Boolean signData) +1008
System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) +91
System.Web.UI.Page.EncryptStringWithIV(String s, IVType ivType) +83
System.Web.UI.Page.EncryptString(String s) +30
System.Web.Handlers.RuntimeScriptResourceHandler.GetScriptResourceUrlImpl(List`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +1497
System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(List`1 assemblyResourceLists, Boolean zip, Boolean notifyScriptLoaded) +1148
System.Web.Handlers.RuntimeScriptResourceHandler.System.Web.Handlers.IScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +152
System.Web.Handlers.ScriptResourceHandler.GetScriptResourceUrl(Assembly assembly, String resourceName, CultureInfo culture, Boolean zip, Boolean notifyScriptLoaded) +37
System.Web.UI.ScriptManager.GetScriptResourceUrl(String resourceName, Assembly assembly) +105
System.Web.UI.ScriptRegistrationManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +113
System.Web.UI.ScriptManager.System.Web.UI.IScriptManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +14
System.Web.UI.ClientScriptManager.RegisterClientScriptResource(Control control, Type type, String resourceName) +53
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e, Boolean registerScript) +113
System.Web.UI.WebControls.Menu.OnPreRender(EventArgs e) +25
System.Web.UI.Control.PreRenderRecursiveInternal() +80
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Control.PreRenderRecursiveInternal() +171
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +842
我可以看到這個選項? - 安全設置>>本地策略>> securityOptions – codetoshare
我知道這是舊的,但我認爲我會在筆記中...此設置可在本地計算機策略>計算機配置> Windows設置>安全設置>本地下的組策略編輯器(gpedit.msc)中找到政策>安全選項。您必須更改iisreset後,謝謝! –