Validation of viewstate MAC failed
We were working with a client on a site and for some reason all of a sudden we got the message below.
Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that
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
configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
This was confusing as we were not sure why we got this, but the solution is thankfully quite simple. Just add the following line in your web.config file and you should be ok.
<system.web>
<pages enableViewStateMac="false" />
</system.web>
Leave a Comment
If you would like to make a comment, please fill out the form below.