gpt4 book ai didi

c# - viewstate MAC 验证失败 - 查看状态错误

转载 作者:太空宇宙 更新时间:2023-11-03 14:33:25 25 4
gpt4 key购买 nike

在我的网站中,当网页空闲时间超过 5 分钟时,该网页将无法正常工作,直到我刷新。出现以下错误:

Error: Sys.WebForms.PageRequestManagerServerErrorException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.

我已经在使用 EnableEventValidation="false"ViewStateEncryptionMode="Never"ValidateRequest="false"

但是,没有什么对我有用。

最佳答案

虽然这是一个老问题,但我还是会回答,因为它可能会对其他人有所帮助。所以我在过去几天遇到了这个问题,我意识到我在将 cookie 配置为 HttpOnly 并需要 SSL 后开始出现此错误:

  </system.web>
<httpCookies httpOnlyCookies="true" requireSSL="true" />
</system.web>

原来我只是忘记配置 Visual Studio 来打开我网站的 SSL URL。所以只要打开正常的Url,就无法发送cookie,这就是错误原因。

为了更改默认 Url,您只需要弄清楚您的 SSL url 是什么:在解决方案资源管理器中单击项目并按 F4(不是右键单击 -> 属性),然后您会在下面看到 SLL URL开发服务器部分。之后,转到项目属性页面(右键单击 -> 属性)并在 Web 选项卡中,将 SSL Url 作为项目 Url。

关于c# - viewstate MAC 验证失败 - 查看状态错误,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/2069786/

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