Frog Bytes

February 26, 2009

Validation of viewstate MAC failed

Filed under: General — mpknet @ 11:28 am

“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 saw a lot of solutions online, but what worked for me is to have my own statically generated Machine Key on Web.Config file.

Go to http://www.aspnetresources.com/tools/keycreator.aspx (or you can write your own code to do this – try this: http://support.microsoft.com/kb/313091/EN-US/)

Then add the following within System.Web, using the keys returned

<machineKey validationKey=”xsajsjsnajsnajsnasnasnajsajn”
decryptionKey=”sajsnajsnajsnajsnaj” validation=”SHA1″ />

No Comments Yet »

No comments yet.

RSS feed for comments on this post. TrackBack URI

Leave a comment

Blog at WordPress.com.