ASP.NET Cafe
new tricks every week

Solution for "Validation of viewstate MAC failed / The state information is invalid for this page and might be corrupted"

Monday, 10 December 2007 02:02 by dmitriy

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.

At least one time in you life you see this message. And this can be a real problem... It's infrequent and hard to reproduce this error.
They are saying something about cluster? I'm on shared hosting... So, why this problem occurs?

It's hard to find why this error occurs. But let me explain why. IIS can shutdown your application if there are no request during some time... And this is because someone just fills big form! (and no other visitors this time). And when someone submits a long form, he receives this, message. I don't know, maybe this was a problem only for me. But solution is quite simple! Always use generated <machineKey>. There are another question... How to generate it? I've found a tool long time ago...

So, use MachineKey generator http://www.aspnetcafe.com/tools/machineKey.aspx

Maybe this stuff can save you several hours... usually, for beginners in ASP.

Be the first to rate this post

  • Currently 0/5 Stars.
  • 1
  • 2
  • 3
  • 4
  • 5
Categories:   ASP.NET
Actions: E-mail | del.icio.us | Kick it! | DZone it! | Permalink | Comments (0) | Comment RSSRSS comment feed

Comments

Add comment


 

  Country flag

biuquote
  • Comment
  • Preview
Loading