RSS 2.0 | Atom 1.0 | CDF

Search

Categories

Archive

Blogroll

Sign In

# Monday, January 30, 2006
Monday, January 30, 2006 10:53:44 PM (GMT Standard Time, UTC+00:00) ( .Net General | Asp.Net )
i kept getting these sporadic error messages on my web applications and i could never figure out why. 
Unable to validate data at
System.Web.Configuration.MachineKey.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at
System.Web.UI.LosFormatter.Deserialize(String input)
searching the net just reveals a troop of similarly frustrated users without solutions.  but today i found the actual reason why, and the work-around.
this excellent post on experts-exchange has the answer.  apparently it happens when users leave a page open for a long time, and then cause a post back.  something to do with the machine key being automatically generated and it changes before the user causes the postback, and it can't validate it then. 
the fix is to set a static machine key. 
There is a kb article with some code to generate a key for you, + instructions.  

Sorted.

Friday, June 16, 2006 6:36:49 PM (GMT Daylight Time, UTC+01:00)
Tim,

Thanks for the article. I do have WebFarm and both the machines have the same static key. However, we still gets such errors twice a week or so. Can you think of anyother solutions?

Shyam
Friday, June 16, 2006 7:09:47 PM (GMT Daylight Time, UTC+01:00)
hi shyam,
you're right, the solution i posted helped the situation somewhat, but i still get occasional errors. i have never seen it happen in my .Net 2.0 applications, so maybe we'll just have to put up with it until the application can be moved to a .net 2.0 environment.

sorry i don't have a better answer.
tim
tim
Tuesday, June 27, 2006 1:41:49 PM (GMT Daylight Time, UTC+01:00)
U R DA MAN! TIM!

I did try the solution from the kb and atleast the errors have abated. I had to use the "AutoGenerate" settings as I am clueless as to how to use the Cryptographic Classes mentioned to create encryption/decryption keys.

To be honest, every little solution helps. And well, I try and tell my clients somehow: dont leave your form half filled and wonder off to have a coffee!!! (not that that would work!)

once again: U R DA MAN!
Tuesday, October 31, 2006 5:56:07 PM (GMT Standard Time, UTC+00:00)
Hi,
I also want to know, how to give value for the autogenerate setting.

Thanks.
madhu
Thursday, January 04, 2007 5:39:49 PM (GMT Standard Time, UTC+00:00)
I have experienced the same problem and in my scenario, creating a static key is a workaround but not a fix.
The fix requires creating registry entries for the identity of the application pool that executes the ASP.NET application. For more info, see: http://jlchereau.blogspot.com/2007/01/unable-to-validate-data-error-in.html
Sunday, March 25, 2007 6:12:06 AM (GMT Daylight Time, UTC+01:00)
I hae found same error.
please help me.
Thursday, November 01, 2007 10:58:41 AM (GMT Standard Time, UTC+00:00)
I am still getting this error in 2.0, so far I have tried everything. And I still get it. I have read every MS KB and tried there hot fixes. but yet I still get it. I am thinking it may have something to do with Dell Servers as this is the first time I am getting this problem, and it is the first time I am hosting a website on a Dell Server.
Wednesday, September 17, 2008 11:09:18 AM (GMT Daylight Time, UTC+01:00)
I get this error - but this is critical - IT ONLY HAPPENS IN FIREFOX!!!! - the same page works fine in IE, but non-IE browsers throw up the "Unable to validate data" exception. The page is nothing special either. Just a couple of images, a textbox and a button. What on earth is the problem?
owen
Wednesday, September 17, 2008 11:13:55 AM (GMT Daylight Time, UTC+01:00)
hi owen, i explain the problem + workaround in the article!! it isn't anything to do with browers, it's just by chance that it happens when using FF.
tim mackey
Tuesday, June 23, 2009 2:13:04 PM (GMT Daylight Time, UTC+01:00)
Hi, Thanks for wonderful article.
Can you please include the full solution from "http://www.experts-exchange.com/Programming/Programming_Languages/Dot_Net/ASP_DOT_NET/Q_21321364.html" .

apprently that web address require membership.

Thanks in advance
Jaswinder Singh
Tuesday, June 23, 2009 2:37:38 PM (GMT Daylight Time, UTC+01:00)
hi jaswinder, yes experts-exchange have totally removed access for non-members. in any case the KB article has more info. best of luck
tim
tim
Thursday, June 25, 2009 5:15:46 PM (GMT Daylight Time, UTC+01:00)
Hey guys -

Just an FYI - you can see Experts Exchange solutions if you arrive from a google search.

The easiest way to do it, is to take the URL of an experts exchange page, and just search it in google, and follow that result. Just scroll to the bottom and you'll see.

I don't know -why- they do this, but I'm sure glad they do. :)
Friday, June 04, 2010 8:00:56 PM (GMT Daylight Time, UTC+01:00)
I finally got fed up with these sporadic errors today and decided to do something about it. Your brief article pointed me in the right direction to fix this problem that I've been ignoring for the last few years. Thank you!
Name
E-mail
Home page

Comment (HTML not allowed)  

Enter the code shown (prevents robots):

Live Comment Preview