viewstate MAC失败网站中的错误 [英] viewstate MAC failed Error in website

查看:64
本文介绍了viewstate MAC失败网站中的错误的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述



我开发了一个网站,但有时我遇到了以下viewstate MAC失败错误

''/''应用程序中的服务器错误.

验证视图状态MAC失败.如果此应用程序由Web场或群集托管,请确保< machinekey>配置指定相同的validationKey和验证算法.自动生成不能在群集中使用.

说明:执行当前Web请求期间发生未处理的异常.请查看堆栈跟踪,以获取有关错误及其在代码中起源的更多信息.

异常详细信息:System.Web.HttpException:验证视图状态MAC失败.如果此应用程序由Web场或群集托管,请确保< machinekey>配置指定相同的validationKey和验证算法.自动生成不能在群集中使用.

源错误:


[没有相关的源代码行]

源文件:App_Web_xb1xuhdw.6.cs行:0
请告诉我为什么会这样,我该怎么解决

谢谢



i hv developed a website but sometimes i got the following viewstate MAC failed error

Server Error in ''/'' Application.

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.

Source Error:


[No relevant source lines]

Source File: App_Web_xb1xuhdw.6.cs Line: 0
pls tell me why it is and what i shud do to solve it

Thanks

推荐答案

您是否正在使用负载均衡的多个服务器?如果是,那么有两种方法可以解决此问题:

1.设置负载均衡器规则,以使来自特定客户端的请求始终转到同一服务器(粘性会话)
2.在所有服务器上设置相同的机器密钥. (在Google中搜索"ASP.NET机器密钥"以了解操作方法)
Are you using multiple servers that are load balanced? If yes, then there are two ways to handle this:

1. Set your Load balancer rule so that requests from a specific client always go to the same server (sticky sessions)
2. Set the same machine key on all the servers. (Search "ASP.NET machine key" in google to see how to do this)


这篇关于viewstate MAC失败网站中的错误的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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