Question

I've checked every post on SO, every post on the internet, but nothing is helping.

I'm getting the Validation of viewstate MAC failed error. It just started failing on our production server all of a sudden. However it works on our staging server, and the files are identical. We discovered that our production server has SP2, while the staging server has SP1.

We're not on a webfarm. I've added this machine key to the web.config:

<machineKey validationKey="AutoGenerate,IsolateApps" decryptionKey="AutoGenerate,IsolateApps" validation="SHA1"/>

I've also tried all of the workarounds here: http://blogs.msdn.com/tom/archive/2008/03/14/validation-of-viewstate-mac-failed-error.aspx.

One other thing I should mention; this isn't happening after a postback. It's happening after a redirect. It seems like most of the cases I've seen on the internet happen after a postback. Not sure if this has anything to do with the error.

Anyway, does anyone have any ideas?

Was it helpful?

Solution

I had a similar problem recently. Here is what I did:

  1. Made sure form elements don't have an action attribute defined.
  2. Generated a unique machineKey for the application instead of using AutoGenerate. You can use this tool to do this easily.

Good luck!

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top