gpt4 book ai didi

asp.net - View 状态 MAC 验证失败

转载 作者:行者123 更新时间:2023-12-02 09:00:24 27 4
gpt4 key购买 nike

我收到此异常,请帮助我解决此问题。

Error Time      : 20091104 151412
Error Message : Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that <machineKey> configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
Source : System.Web
StackTrace : 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.bla_bls_aspx.ProcessRequest(HttpContext context) in c:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\root\87932190\f6393965\App_Web_slwxkxn3.2.cs:line 0
at System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
Target Site : Void ThrowError(System.Exception, System.String, System.String, Boolean)
Inner Exception : System.Web.UI.ViewStateException: Invalid viewstate.
Client IP: 172.16.153.71
Port: 1466
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.0; .NET CLR 2.0.50727)
ViewState: /wEPDwUKLTg3MDIzOTc1Ng9kFgICAw9kFgICAw9kFgJmD2QWBgIdD2QWAgIBDzwrAA0BAA8WBB4LXyFEYXRhQm91bmRnHgtfIUl0ZW1Db3VudAIUZBYCZg9kFioCAQ9kFhpmDw8WAh4EVGV4dAUDODU4ZGQCAQ8PFgIfAgUKMSAgICAgICAgIGRkAgIPDxYCHwIFDE5ZS1UgNjEwOTc1MGRkAgMPDxYCHwIFAzQwJ2RkAgQPDxYCHwIFA05ZS2RkAgUPDxYCHwIFClgtUHJlc3MgMjFkZAIGDw8WAh8CBRQzMCBPY3QgMjAwOSAwNDowMDowMGRkAgcPDxYCHwIFB1RFTEZPUkRkZAIIDw8WAh8CBQJJS2RkAgkPDxYCHwIFAkZHZGQCCg8PFgQeCUJhY2tDb2xvcgqmAR4EXyFTQgIIZBYCAgEPDxYCHwIFCkluIFByb2Nlc3NkZAILDw8WBB8DCqcBHwQCCGQWAgIBDw8WAh8CBRQwNCBOb3YgMjAwOSAxMTowMDowMGRkAgwPZBYCAgEPDxYCHwIFBkV4ZmFjdGRkAgIPZBYaZg8PFgIfAgUDODU1ZGQCAQ8PFgIfAgUKMiAgICAgICAgIGRkAgIPDxYCHwIFDE5ZS1UgODQ0Mzc0NWRkAgMPDxYCHwIFAzQwJ2RkAgQPDxYCHwIFA05ZS2RkAgUPDxYCHwIFClgtUHJlc3MgMjFkZAIGDw8WAh8CBRQyOSBPY3QgMjAwOSAwMzozMDowMGRkAgcPDxYCHwIFB1RFTEZPUkRkZAIIDw8WAh8CBQJJS2RkAgkPDxYCHwIFAkZHZGQCCg8PFgQfAwqmAR8EAghkFgICAQ8PFgIfAgUKSW4gUHJvY2Vzc2RkAgsPDx... ---> System.Web.HttpException: Unable to validate data.
at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength)
at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)
--- End of inner exception stack trace ---

最佳答案

如果您的服务器作为集群的一部分运行(即对应用程序的请求在多个服务器之间平衡),则必须确保您的计算机全部配置为使用相同的计算 secret 钥。

当回发发生时,ASP.NET 对 ViewState 数据执行验证。此验证使用私钥(机器 key )来保证数据的完整性。如果您没有明确指定此 key ,则会为您生成该 key 。不同的机器将生成不同的 key ,因此负载平衡的请求可能会失败验证,因为它们根据不同的 key 进行验证,具体取决于页面首次提供服务的位置以及回发的位置。

This article告诉您有关机器 key 的用途以及如何配置服务器的更多信息。

关于asp.net - View 状态 MAC 验证失败,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/1672573/

27 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com