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

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

问题描述

我收到的asp.net网站在某些时候下面的错误。

I am receiving the following error at certain times on asp.net website.

 Sys.WebForms.PageRequestManagerServerErrorException: 
 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.

在页面刷新的推移,没有problem.How我能解决这个问题?

When page refresh goes,no problem.How can I solve this problem?

推荐答案

如果您使用的是Web场并运行在多台计算机相同的应用程序,你需要在machine.config文件中明确定义了计算机密钥:

If you're using a web farm and running the same application on multiple computers, you need to define the machine key explicitly in the machine.config file:

<machineKey validationKey="JFDSGOIEURTJKTREKOIRUWTKLRJTKUROIUFLKSIOSUGOIFDS..." decryptionKey="KAJDFOIAUOILKER534095U43098435H43OI5098479854" validation="SHA1" />

把它下的&LT;的System.Web方式&gt; 标签

有机器code中的自动生成,不能使用。生成自己的machineKey看到这个PowerShell脚本:
http://support.microsoft.com/kb/2915218#AppendixA

The AutoGenerate for the machine code can not be used. To generate your own machineKey see this powershell script: http://support.microsoft.com/kb/2915218#AppendixA

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

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