Validation of viewstate MAC failed

坚强是说给别人听的谎言 提交于 2019-12-08 05:44:21

问题


I am currently receiving this error:

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.

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" />

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


回答1:


Is your web app hosted in a webfarm?

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.

It will work on ASP.NET 3.5 as well.



来源:https://stackoverflow.com/questions/331720/validation-of-viewstate-mac-failed

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!