When I click after about 15 minutes on a page I wrote I recieve the
following error:
Server Error in '/' Application.
--------------------------------------------------------------------------------
Validation of viewstate MAC failed. If this application is hosted by a Web
Farm or cluster, ensure that <machineKeyconf iguration specifies the same
validationKey and validation algorithm. AutoGenerate cannot be used in a
cluster.
Description: An unhandled exception occurred during the execution of the
current web request. Please review the stack trace for more information
about the error and where it originated in the code.
Exception Details: System.Web.Http Exception: Validation of viewstate MAC
failed. If this application is hosted by a Web Farm or cluster, ensure that
<machineKeyconf iguration specifies the same validationKey and validation
algorithm. AutoGenerate cannot be used in a cluster.
Source Error:
The source code that generated this unhandled exception can only be
shown when compiled in debug mode. To enable this, please follow one of the
below steps, then request the URL:
1. Add a "Debug=true " directive at the top of the file that generated
the error. Example:
<%@ Page Language="C#" Debug="true" %>
or:
2) Add the following section to the configuration file of your
application:
<configuratio n>
<system.web>
<compilation debug="true"/>
</system.web>
</configuration>
Note that this second technique will cause all files within a given
application to be compiled in debug mode. The first technique will cause
only that particular file to be compiled in debug mode.
Important: Running applications in debug mode does incur a
memory/performance overhead. You should make sure that an application has
debugging disabled before deploying into production scenario.
Stack Trace:
[HttpException (0x80004005): Unable to validate data.]
System.Web.Conf iguration.Machi neKeySection.Ge tDecodedData(By te[] buf,
Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +2549692
System.Web.UI.O bjectStateForma tter.Deserializ e(String inputString) +214
[ViewStateExcept ion: Invalid viewstate.
Client IP: 72.81.21.124
Port: 50536
User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET
CLR 1.1.4322; .NET CLR 2.0.50727; .NET CLR 3.0.04506.30)
ViewState:
/wEPDwULLTE4MzE4 MzkwNDgPZBYCAgM PZBYSAgEPDxYCHg RUZXh0BSVDb21wb GV4IENhc2UgSGln aGxpZ2h0IChJdGV tcyAx4oCTMTApZG QCBA8PFgIfAAW7A 0EgMzUteWVhci1v bGQgQWZyaWNhbi1 BbWVyaWNhbiBtYW 4gcHJlc2VudHMgd G8geW91IGZvciBo aXMgYW5udWFsIOK AnHBoeXNpY2FsIG V4YW0u4oCdIEhlI GhhcyBubyBzaWdu aWZpY2FudCBjb21 wbGFpbnRzIGJ1dC BpcyBjb25jZXJuZ WQgYmVjYXVzZSBo aXMgb2xkZXIgc2l zdGVyIHdhcyBqdX N0IGRpYWdub3NlZ CB3aXRoIHR5cGUg MiBkaWFiZXRlcy4 gSGlzIGZhdGhlci BhbHNvIGhhZCB0e XBlIDIgZGlhYmV0 ZXMgYW5kIGRpZWQ gYXQgYWdlIDU0IG 9mIGEgbXlvY2FyZ GlhbCBpbmZhcmN0 aW9uLiBIZSBoYXM gdHdvIHNvbnMgYW dlIDEwIGFuZCAxM iwgYm90aCA+MTIw JSBvZiBpZGVhbCB 3ZWlnaHQgZm9yIH RoZWlyIGhlaWdod C4gSGUgaXMgNuKA mTDigJ0gYW5kIHd laWdocyAyMTAgbG JzIChCTUkgMjcga 2cvbTIpOyBibG9v ZCBwcmVzc3VyZSB pcyAxMzgvODggbW 0gSGcuZGQCBw8PF gIfAAU0Q3VycmVu dCBsYWIgcmVzdWx 0cyBmb3IgdGhpcy BwYXRpZW50IGFyZ SBhcyBmb2xsb3dz OmRkAgoPDxYIHgh JbWFnZVVybAUSaW 1hZ2VzL01...]
[HttpException (0x80004005): 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.]
System.Web.UI.V iewStateExcepti on.ThrowError(E xception inner, String
persistedState, String errorPageMessag e, Boolean macValidationEr ror) +116
System.Web.UI.O bjectStateForma tter.Deserializ e(String inputString) +251
System.Web.UI.O bjectStateForma tter.System.Web .UI.IStateForma tter.Deserializ e(String
serializedState ) +4
System.Web.UI.U til.Deserialize WithAssert(ISta teFormatter formatter,
String serializedState ) +37
System.Web.UI.H iddenFieldPageS tatePersister.L oad() +220
System.Web.UI.P age.LoadPageSta teFromPersisten ceMedium() +83
System.Web.UI.P age.LoadAllStat e() +35
System.Web.UI.P age.ProcessRequ estMain(Boolean
includeStagesBe foreAsyncPoint, Boolean includeStagesAf terAsyncPoint) +6953
System.Web.UI.P age.ProcessRequ est(Boolean includeStagesBe foreAsyncPoint,
Boolean includeStagesAf terAsyncPoint) +154
System.Web.UI.P age.ProcessRequ est() +86
System.Web.UI.P age.ProcessRequ estWithNoAssert (HttpContext context) +18
System.Web.UI.P age.ProcessRequ est(HttpContext context) +49
ASP.default_asp x.ProcessReques t(HttpContext context) +29
System.Web.Call HandlerExecutio nStep.System.We b.HttpApplicati on.IExecutionSt ep.Execute()
+154
System.Web.Http Application.Exe cuteStep(IExecu tionStep step, Boolean&
completedSynchr onously) +64
--------------------------------------------------------------------------------
Version Information: Microsoft .NET Framework Version:2.0.507 27.42; ASP.NET
Version:2.0.507 27.210
I have no idea why this happens, and am unfamiliar with viewstate MAC. Can
anyone give me a starting point? Thanks.
--
Nathan Sokalski
nj********@hotm ail.com
http://www.nathansokalski.com/