好的,这个话题在互联网上并不是新鲜事,我明白了。但我还没有找到解决方案来解决我的问题。视图状态MAC验证失败,每天失败50次
问题是我一直在我的网站上捕捉到这个异常。也许每天50次左右。 (请参阅下面的堆栈跟踪)
验证视图状态MAC失败。如果此应用程序由Web Farm或群集托管,请确保配置指定相同的验证密钥和验证算法。 AutoGenerate不能在群集中使用。
我已经在我的web.config文件中预定义了一个machinekey - 根本没有任何帮助。 然后我读了一些地方,我可能是一个缓慢的加载造成的错误,但我记录页面加载时间,并且当这个错误发生时,theres没有什么惊人的。 一些ppl建议禁用视图状态解密,但是作为很多其他ppl写入,这不是一个真正的解决方案。
任何人都知道该怎么办?
堆栈跟踪:
at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError)
at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState)
at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState)
at System.Web.UI.HiddenFieldPageStatePersister.Load()
at System.Web.UI.Page.LoadPageStateFromPersistenceMedium()
at System.Web.UI.Page.LoadAllState()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
at System.Web.UI.Page.ProcessRequest()
at System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context)
at System.Web.UI.Page.ProcessRequest(HttpContext context)
at ASP.default_aspx.ProcessRequest(HttpContext context)
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
您是否在Web场或群集中运行?有多台服务器? – Tejo
您是否试图捕获失败的视图状态并查看其中的内容? – toxaq
我刚刚在我的本地主机上调试时第一次出错,不知道为什么想到,但至少我可以说我的本地主机不在网络农场。我试图捕捉不到,但生病了! –