This topic is locked
[SOLVED]

 Validation of viewstate MAC failed

9/12/2006 12:03:59 PM
ASPRunner.NET General questions
swat author

Server Error in '/aspnet' Application.

--------------------------------------------------------------------------------
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.

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.HttpException: 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.
Source Error:
[No relevant source lines]
Source File: c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aspnet\9eac2755\41537dcc\App_Web_uyn1u_cc.0.cs Line: 0
Stack Trace:
[HttpException (0x80004005): Unable to validate data.]

System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +2546764

System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +214
[ViewStateException: Invalid viewstate.

Client IP: 185.23....

Port: 4375

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 1.1.4322; .NET CLR 2.0.50727)

ViewState: 6hMxFLUQQhdDB5O7QqRv0duNlhP5/c1e4qzoAvptbXYI+6Oy/Yq4VWOu3U820mwHiD9dOTbfTw78xA2IO2p2pzYVeBKmMGJccwsq1DLvViOg184s6TqUscbADvsdg0OJa

ymIn8K6R4sHtnCnt4km6FqEnCn6bAUfXjP76m0ahEEih/pKwdmsk1IVrqD4OWco24XhFhEEAg28FJ9lE7tVKgaADcM2Dzwv3476IG8N9D0rO8SHHtm2+9I3Tcx1wY

UUAG6ytgRmIeSqQL4liQvWXVLyQwnbkvbL5fssE2KcJ/UA5rMULmHWuiySA9bRx05rySGPmGTYVJk9mavqZCG8KHqwRdsC2BsupVDRidAB/yJ8rJUe5Z6i79doYEfDmnovs+DvWYLyWzxv8ONLeGQSfFUPLIw4qEu/tzblYoZNdKSRMdjAOwGxP41NVecm6pOAr8JVHaAQB6FyBDKab0dWnuEEQp7OTkOVNGQwxFPaHp+ijxdJ

yjocKdliMWUfrWA+K1w/7XngwtxKRM7tLNk4+9IBB04mnA+OFUu6qLz9d/7vHPNBS+PHgm5wfZ8gFO2lP5sokgJL00Y+YtCbw82bx7+sK7k/2Q13gn04nTNEsjzLIPYrPulT2va687bRvfMrVbSQjJsLwzz3ESHf+ik7co4IUbW7FtIR0ZZPlBuNizT/Lk0jcQ788S3ZvnVc7QAgBf5w79N8vR8S1R19m/9fQ4nXr8fywFjVGzlC1rHwu+/J6za+UAEPWJWAv248sQkEOmVMa0RQMUK6MYbK9ExRBqvxCvKTyM/W+3hNM3LEgAN/cJcKtnmdo9tVXHb77tcSkQILr+i+zsf3WGQLVd5pL/l0Aaq...]
[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.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +116

System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +251

System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(Str

ing serializedState) +4

System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37

System.Web.UI.HiddenFieldPageStatePersister.Load() +220

System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +83

System.Web.UI.Page.LoadAllState() +35

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +6953

System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +154

System.Web.UI.Page.ProcessRequest() +86

System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +18

System.Web.UI.Page.ProcessRequest(HttpContext context) +49

ASP.vol_data_list_aspx.ProcessRequest(HttpContext context) in c:\WINNT\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\aspnet\9eac2755\41537dcc\App_Web_uyn1u_cc.0.cs:0

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Ex

ecute() +154

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42

Eugene 9/12/2006

try to add this string in <system.web> section of your web.config file :

<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" />

for fix "Validation of viewstate MAC failed" error.

G
gurdeep009 5/7/2008

try to add this string in <system.web> section of your web.config file :

<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" />

for fix "Validation of viewstate MAC failed" error.


<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=28927&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> Thanx its working

G
gurdeep009 5/7/2008



<img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=28928&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> Thanx its working


Please tell me how it is working, and why this exception occur <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=28928&image=2&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=28928&image=3&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=28928&image=4&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />

Eugene 5/8/2008

Please tell me how it is working, and why this exception occur <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=29014&image=1&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=29014&image=2&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' /> <img src='https://asprunner.com/forums/file.php?topicimage=1&fieldname=reply&id=29014&image=3&table=forumreplies' class='bbc_emoticon' alt=':rolleyes:' />



You can get more info about this error here: http://forums.asp.net/p/955145/1173230.aspx

Z
zubairhassan 8/19/2008



You can get more info about this error here: http://forums.asp.net/p/955145/1173230.aspx



-------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------
Welll, its depend it could be many reasons in my case, Leave that screen idle for 10 minute you'll see the error.

X
XAssassin007 12/13/2008

i have the same problem, i tries what u suggested but it didn't work. i walso tried the solution given on:
Link
but it didn't work either..Also m not using any type of Database or grid view or any type of such tool..not yet in my web-site
the error that its showing in detail is:
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.

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.HttpException: 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.
Source Error:
[No relevant source lines]
Source File: e:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\prac_customercomplaintsystem\022c4ba9\63b76ec5\App_Web_d-vmdutp.8.cs Line: 0
Stack Trace:
[HttpException (0x80004005): Unable to validate data.]

System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) +348

System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +199
[ViewStateException: Invalid viewstate.

Client IP: 127.0.0.1

Port:

User-Agent: Mozilla/4.0 (compatible; MSIE 6.0; Windows NT 5.1; SV1; .NET CLR 2.0.50727; InfoPath.2)

ViewState: /wEPDwULLTE5NTg4NTUwODgPZBYCZg9kFgICAw9kFgICBQ9kFgICBQ9kFgQCAQ9kFgRmDw8WBB4IQ3NzQ

2xhc3MFD2FjY29yZGlvbkhlYWRlch4EXyFTQgICZGQCAQ8PFgQfAAUQYWNjb3JkaW9uQ29udGVudB8BA

g

IWAh4Fc3R5bGUFDmRpc3BsYXk6YmxvY2s7ZAICD2QWBGYPDxYEHwAFD2FjY29yZGlvbkhlYWRlch8BAg

J

kZAIBDw8WBB8ABRBhY2NvcmRpb25Db250ZW50HwECAhYCHwIFDWRpc3BsYXk6bm9uZTsWAgIBDzwrAA0

A

ZBgBBSljdGwwMCRDb250ZW50UGxhY2VIb2xkZXIxJGN0bDAzJEdyaWRWaWV3MQ9nZNUjkToPgmNShf5l

Z

KAvxd25f3Tx

Referer: http://localhost:1209/Prac_CustomerComplai...New_Compln.aspx

Path: /Prac_CustomerComplaintSystem/Home.aspx]
[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.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) +119

System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) +235

System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(Str

ing serializedState) +5

System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) +37

System.Web.UI.HiddenFieldPageStatePersister.Load() +222

System.Web.UI.Page.LoadPageStateFromPersistenceMedium() +80

System.Web.UI.Page.LoadAllState() +35

System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +7994

System.Web.UI.Page.ProcessRequest(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +158

System.Web.UI.Page.ProcessRequest() +85

System.Web.UI.Page.ProcessRequestWithNoAssert(HttpContext context) +20

System.Web.UI.Page.ProcessRequest(HttpContext context) +110

ASP.home_aspx.ProcessRequest(HttpContext context) in e:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\Temporary ASP.NET Files\prac_customercomplaintsystem\022c4ba9\63b76ec5\App_Web_d-vmdutp.8.cs:0

System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Ex

ecute() +317

System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +65
--------------------------------------------------------------------------------

Version Information: Microsoft .NET Framework Version:2.0.50727.42; ASP.NET Version:2.0.50727.42
Reply ASAP;
Regards

Eugene 12/17/2008

Probably, this post can help you: http://www.sitepoint.com/forums/showthread.php?t=585291
If you still have this bug, please send me your project (including project file, output directory and database backup) on support@xlinesoft.com? I will investigate it on my box.