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.

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.

This error can be cleared up in most cases by putting a machine Key (and associated details) into your web.config. If need be, you can generate a set of these details here:

http://aspnetresources.com/tools/keycreator.aspx


Posted

in

by

Tags:

Comments

2 responses to “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.”

  1. Des Moines Web Designer Avatar

    Thanks for the informative post! After adding this variable and rolling out the web.config, I still occasionally see this error. My website is hosted on a web farm. Are there any other possible causes of this error message?

    1. feonix83 Avatar

      Depending on how your host does their setup, the file may take a few minutes to replicate across servers, or may be cached on some. I recommend double checking with your web host and seeing what they say. If you do find your answer, please, come back and post it here, as I will gladly update my main post for it.

Leave a Reply

Your email address will not be published. Required fields are marked *