【发布时间】:2012-03-30 17:11:11
【问题描述】:
请帮助我解决我使用 c# asp.net 的 Web 应用程序中出现的随机错误。错误如下:
"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."
【问题讨论】:
-
您使用什么版本的 .Net?试试this thread
-
该错误为您提供了您需要在 web.config 上放置的内容。为两个 web.configs 修复相同的机器密钥
-
错误信息很清楚 - 您是否在网络场中运行?如果是这样,您需要确保所有实例的
<machineKey>相同。 -
如何添加机器密钥以及机器密钥的值是什么