验证视图状态MAC失败

时间:2010-11-03 17:03:31

标签: validation iis-7 asp.net-2.0 viewstate validationerror

我们最近将所有网站从一台服务器(IIS6)迁移到新服务器(IIS7),该服务器还涉及更改所有DNS记录。但是,在某些网站上,当您在某些网页上进行回复时,会出现以下错误:

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. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.Web.HttpException: 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.

起初我认为这可能是该网站的传播问题(即它试图回发到旧服务器)。但是,DNS记录在2周前发生了变化,所以情况肯定不是这样。

为什么会出现这个错误?

值得注意的是,旧服务器上从未发生此错误。

1 个答案:

答案 0 :(得分:1)

这可能是与asp.net-2.0相关的错误。您使用的是哪个版本 - 该错误已在SP2中修复。