在asp帐户登录页面上验证viewstate MAC失败

时间:2014-05-29 13:41:37

标签: c# web-config

所以,我已经尝试过对此进行研究,而我发现这个问题的每个人都没有和我一样的问题。这只会随机弹出,只会在我内置的Visual Studio捆绑包附带的/Account/Login.aspx页面中弹出。应该注意的是,我的web.config文件中已经有以下代码:

<machineKey validationKey="string" decryptionKey="other string" validation="SHA1" decryption="AES" />

这是错误:

  

System.Web.HttpException(0x80004005):验证viewstate MAC   失败。如果此应用程序由Web场或群集托管,请确保   该配置指定相同的validationKey和   验证算法。无法在群集中使用AutoGenerate。

http://go.microsoft.com/fwlink/?LinkID=314055 ---> System.Web.UI.ViewStateException: Invalid viewstate.
        Client IP: 119.235.50.194
        Port: 4371
        Path: /Account/Login.aspx
        User-Agent: Mozilla/5.0 (Windows NT 5.1) AppleWebKit/534.30 (KHTML, like Gecko) Chrome/12.0.742.122 Safari/534.30
        ViewState: 2PEjFD7WetrOkkYIap6Nm/DWt4gGBXBxyliWBhLBWfTkaxQKL4RzlrSF222wi55VWRHypnbmYNtYYLrdtdBhWoyKIN+0e5Jk1PsTwoYuTAs50ZBrAB+n+PH3gu5PXUkYUYZytUW01l3XdHAfndC0TkMOIX/coq1YK9UqCPKcQC+3orNIqmAQKeKvL0/L6vQIH2TzD+49sSatHa33Rel4kBrtoNTlFmwArxSIuZF7lWAgY5NBeuzlP6EX4WeYaNDWCrdMO/lnhxNeskEtX4NmOsxTCjgGCLBAsWgd0rRBqzC1ejrPV+gjca7gctv4pCuFspRs0TFu237iGu1ZHYgVNkelYdfmPzDS+k8WXpvU/jStT3ox5L00IFjQ1CPy96I3MPiSg+YtgxxWFKJLoxsxlCZNCckVt1qf5icxIgTHL8G/JFPC3O4JbiRQdacQf2sU4NrXFQdPZdojzpxLt0dZ8uqMTsM=
   at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
   at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString, Purpose purpose)
   at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter2.Deserialize(String serializedState, Purpose purpose)
   at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter2 formatter, String serializedState, Purpose purpose)
   at System.Web.UI.HiddenFieldPageStatePersister.Load()
   at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
   at System.Web.UI.Page.LoadAllState()
   at System.Web.UI.Page.<ProcessRequestMainAsync>d__14.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.Util.WithinCancellableCallbackTaskAwaitable.WithinCancellableCallbackTaskAwaiter.GetResult()
   at System.Web.UI.Page.<ProcessRequestAsync>d__10.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.UI.Page.<ProcessRequestAsync>d__2c.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Web.TaskAsyncHelper.EndTask(IAsyncResult ar)
   at System.Web.UI.Page.AsyncPageEndProcessRequest(IAsyncResult result)
   at ASP.account_login_aspx.EndProcessRequest(IAsyncResult ar) in c:\windows\Microsoft.NET\Framework\v4.0.30319\Temporary ASP.NET Files\root\0503be1f\8398e47d\App_Web_nf3qnykt.6.cs:line 0
   at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
   at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously

谢谢,克里斯:)

0 个答案:

没有答案