Jump to: navigation, search

Unable to validate data

Versione del 1 Dic 2008 alle 09:21 di Gabriele.murari (Discussione | contributi) (Nuova pagina: This error occurs on a .net web application runs on a Windows 2003 Server. Here's the stack trace: ''Unable to validate data.'' ''at System.Web.Configuration.MachineKeySection.GetDe...)
(diff) ←Older revision | view current revision (diff) | Newer revision→ (diff)

This error occurs on a .net web application runs on a Windows 2003 Server.

Here's the stack trace:

Unable to validate data.

at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString)

Many developers seem to solve the problem at least partially by generating a static key as described in Microsoft's knowledge base[1].

This is a workaround but not an actual solution to the problem, at least in my scenario where my application runs in a dedicated application pool under limited privileges as described in http://msdn2.microsoft.com/en-us/library/ms998297.aspx. The fix is to run aspnet_regiis.exe –ga DOMAIN\USER where USER is the identity of the application pool. Also make sure the user is part of the IIS_WPG group. This command gives not only access to the IIS metabase but also creates the registry keys required in

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\ASP.NET\2.0.50727.0\AutoGenKeys

for the application pool to generate machine keys.