我有幾個網站,其中獲得約3000網頁瀏覽量每天總,我得到這個錯誤的ViewState每天大約5-10次,夾在Global.asax中:無法驗證數據。在System.Web.Configuration.MachineKeySection.GetDecodedData
System.Web.HttpException:無法驗證數據。在System.Web.Configuration.MachineKeySection.GetDecodedData(字節[] buf中,字節[]改性劑,的Int32開始,的Int32長度,的Int32 & DATALENGTH)在System.Web.UI.ObjectStateFormatter.Deserialize(字符串inputString)
我曾嘗試:
- 硬編碼在web.config中的計算機密鑰的所有網站
- 硬編碼machine.config中machien關鍵
- 將項目添加到web.config文件中的部分頁面所有網站。
機鍵的樣子:
<machineKey validationKey="key goes here" decryptionKey="key goes here" validation="SHA1" decryption="AES" />
頁部分看起來像:
<pages renderAllHiddenFieldsAtTopOfForm="true" validateRequest="false" enableEventValidation="false" viewStateEncryptionMode="Never">
的錯誤是不相關的應用程序池回收,盡我可以告訴,因爲池設置每100,000次請求就會回收。我沒有運行網絡農場或網絡花園。通常,我會連續得到兩三個這樣的錯誤,就好像用戶出現錯誤,返回,然後再次單擊該鏈接。
任何人有任何想法?
之外的另一種改型今天突然出現了,不知道其相關? System.FormatException:Base-64字符串中的無效字符。 System.Web.UI.HiddenFieldPageStatePersister上System.Web.UI.Util.DeserializeWithAssert(IStateFormatter格式程序,字符串serializedState)上System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)上System.Web.UI.Util.DeserializeWithAssert System.Convert.FromBase64String(String s)。 Load() – 2010-04-17 21:14:16
你有ELMAH設置嗎? http://dotnetslackers.com/articles/aspnet/ErrorLoggingModulesAndHandlers.aspx可能會給你更多的例外情況? – lomaxx 2010-04-22 12:23:32