“视图状态 MAC 验证失败”问题,没有负载平衡、集群或服务器场

发布于 2024-11-08 23:45:27 字数 325 浏览 3 评论 0原文

这是我们在许多网站上遇到的一个特别无益且困难的问题。这些都是相当高流量且复杂的站点,但它们都在一个盒子上 - 没有负载平衡或网络场。可靠地重现非常困难,但任何有关潜在修复的想法将不胜感激。

需要强调的是,该问题的发生非常间歇性(可能是百分之一?),在这个阶段,我无法隔离网站上导致问题的任何特定操作。

我们能想到的唯一真正的解决方案是将站点转换为 MVC,但正如您可以想象的那样,这是一项非常艰巨的任务。

站点是用 .NET3.5 构建的,显然是基于 Web 表单的,托管在运行 Windows Server 2008 标准、32 位、IIS7 的机器上,应用程序池在“经典”模式下运行。

This is a particularly unhelpful and difficult issue that we're experiencing with a number of sites. These are reasonably high-traffic and complex sites, but they're all on the one box - there's no load-balancing or web farm going on. It's very hard to reliably reproduce but any ideas about potential fixes would be appreciated.

Just to emphasise, the problem happens very intermittently (maybe 1 in a 100?) and at this stage I can't isolate any particular action on the site causing the problem.

The only genuine solution we can think of is converting the sites to MVC, but as you can imagine this is a really big task.

Sites are built in .NET3.5, are obviously web forms based, hosted on a box running Windows Server 2008 standard, 32-bit, IIS7, application pools runing in 'Classic' mode.

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

等往事风中吹 2024-11-15 23:45:27

好的,我可以通过长时间保留登录表单然后填写表单并点击提交来重现此错误。在搜索“viewstate expire”并阅读更多内容后,我尝试在 Web.config 中手动设置该元素。

要添加到 Web.config 文件的特定元素是:

<system.web>
  <machineKey
    validationKey="EEF33150A048D162D22CB36E1CB9956B148C7A4E6999D0F05B53D416D7A16F83823DD626F501DD3549D3E5DCB473634739D0AD9A07F71560946498C943A7586D"
    decryptionKey="0E95F75864047EB6322EA7D5246F2C1175D77A1B016F293C3BAAD000299A3DC8"
    validation="SHA1"
    decryption="AES" />
</system.web>

validationKeydecryptionKey 属性中的值只是随机生成的十六进制数字,但需要恰好是 128 和 64分别为字节。

OK, I was able to reproduce this error by leaving the login form for a long time then filling in the form and hitting submit. After searching for 'viewstate expire' and reading around a bit more I've had a go at manually setting the element in my Web.config.

The specific element to add to your Web.config file is:

<system.web>
  <machineKey
    validationKey="EEF33150A048D162D22CB36E1CB9956B148C7A4E6999D0F05B53D416D7A16F83823DD626F501DD3549D3E5DCB473634739D0AD9A07F71560946498C943A7586D"
    decryptionKey="0E95F75864047EB6322EA7D5246F2C1175D77A1B016F293C3BAAD000299A3DC8"
    validation="SHA1"
    decryption="AES" />
</system.web>

The values in the validationKey and decryptionKey attributes are just randomly generated hex numbers, but need to be exactly 128 and 64 bytes respectively.

~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文