视图状态MAC的验证失败 [英] Validation of viewstate MAC failed

查看:230
本文介绍了视图状态MAC的验证失败的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我目前收到此错误:

视图状态MAC的验证失败。如果此应用程序由网络场或群集承载,确保<将machineKey> 配置指定了相同的validationKey和验证算法。自动生成不能在集群中使用。

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.

我已经找到多种解决方案,这一错误。我们目前使用的解决方案是增加一个静态的machineKey场在机器水平和使用静态验证密钥和解密密钥。

I have found multiple solutions to this error. The solution we are currently using is to add a static MachineKey field at the machine level and to use static validation keys and decryption keys.

<MachineKey validationKey="" decryptionKey="" validation="SHA1" decruption="AES" />

是否适用于.NET 3.5这个解决方案的工作?有没有更好的解决方案?

Will this solution work for .NET 3.5? Is there a more elegant solution?

推荐答案

托管在一个webfarm你的web应用程序?

Is your web app hosted in a webfarm?

如果如此,这样做的原因是,一个页由服务器1呈现,并发布到服务器2。因此,机键是不同的,并且所述验证失败。

If so, the reason for this is that a page is rendered by server 1, and posted to server 2. Therefore, machine keys are different, and the validation failed.

这将工作在ASP.NET 3.5为好。

It will work on ASP.NET 3.5 as well.

这篇关于视图状态MAC的验证失败的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆