.NET Tutorials, Forums, Interview Questions And Answers
Welcome :Guest
Sign In
Register
 
Win Surprise Gifts!!!
Congratulations!!!


Top 5 Contributors of the Month
ASPEvil
david stephan
Santhakumar Munuswamy
Fauzul Azmi
Post New Web Links

"Validation of viewstate MAC failed."

Posted By:      Posted Date: October 14, 2010    Points: 0   Category :ASP.Net
 

Error message

------------------------

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.


Conditions

------------------------


- We are not on a web-farm or cluster.

- The web.config file of this ASP.NET program is:

<?xml version="1.0"?>
<!--
  For more information on how to configure your ASP.NET application, please visit
  http://go.microsoft.com/fwlink/?LinkId=169433
  -->
<configuration>
	<system.web>
    <compil


View Complete Post


More Related Resource Links

Validation of viewstate MAC failed

  
Hi Experts,I have received an error "Validation of viewstate MAC failed".I am hosting the web site on my own server, so there is nothing like a "Web Farm or cluster". Can you please advise what could be the problem with this error.I only get this error if the page is left inactive for more then 20 minutes and it throws the exception, so users have log-off and login to continue working fine.See below full error details. Server Error in '/datacapv2' 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: The source code that generated this unhandled exceptio

Validation of viewstate MAC failed

  

Hello Guys we have a GPS website which is accesed all around the globe.Customers are complaining that when they keep the website running for longer periods and click the refresh button this ViewState MAC failed error appears on their page.All they had to do again is to relogin to website to keep track of their vessels .

The production webserver is not a WEBFARM or CLUSTER.

Some Important points:

 1.We have auto-update set to 15 mins for updating the map on the webpage for vessel positions by connecting to the database and weather data.

2.They can also use refresh button to update the vessel positions and weather data on the map.

so when the customer keeps the website running for longer periods at some moment it stops updating itself(I think it looses database connection) and when customer sees it and click the refresh button the ViewStateMAC validation error occurs.

I have gone through forums and have got some multiple solutions to apply but which is the correct one

1.Extending Application pool recycling periods.

2.Set EnableViewStateMac = false(But I can do this as i will have to compromise on security which is not right)

3.EnableViewStateEncryption=false...........

4.Machine key algorithm.


Validation of viewstate MAC failed Error after Uploading to Web Server

  

I'm trying to figure out this error but I can't point out what's exactly causing this.

Here is what's happening.

User loggs in for a few hours and gets "Validation of viewstate MAC failed" Error after post back.

I have set timeout in Web.config as follow.

<authentication mode="Forms">
            <forms timeout="540" slidingExpiration="true" loginUrl="~/maintain/login.aspx" />
</authentication>


in IIS I have set

ApplicationPool - Idle Time-out 60min

Sesstion State - Cookei Settings Mode: User Cookies, Time-out: 540min


And I'm using this ifame to prevent Idle

http://wiki.asp.net/page.aspx/1086/keep-session-alive/


Emplyee logges in for 8 hours and having this issue a few time a day...


Do you know what else I should look?

I don't know why session expires.


Thank you for your help

Emplyee





Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure t

  
  • I am new to asp.net etc.

I have developed a website that has began to act unusually. I get the following error below.

 

 

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:

 

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:

 &nbs

url rewriting causing Validation of viewstate MAC failed

  

Hi,

    Has anyone encountered while using Context.RewriteUrl in global.asax causes this error: 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 ?

   Here is the scenario, let's say I have a url http://mysite.com/admin/login.aspx instead typing the whole url in address, user can type either http://mysite.com/admin/ or http://mysite.com/admin  which all end up at http://mysite.com/admin/login.aspx. When a user type http://mysite.com/admin and entered correct login info, and press login button it gets the error above. How can I resolve this? Tried setting EnableValidateRequest to false and EnableViewstateMac to false also even I do not want to use this approach and still does not work.

   


Validation of Viewstate MAC Failed -- when session out.

  

Hi all,

I have an issue that has been bothering me for weeks now without a possibility of fixing it.


I have an ASP.NET 3.5 application developed locally which uses Session variables to hold the user login flag and similar pieces of data. Once I had the application moved to a shared hosting environment [GoDaddy], I started experiencing some weird behaviour. Let me explain the process first:


  1. Every page within the application [in the Page_Load event] checks whether the user is logged in or not. If not, it redirects to the login page.
  2. When I forcefully logout [using a procedure that clears the session variables] all is fine.
  3. However, when I leave the page open for more than 30 minutes, and I let the session variables get destroyed by themselves, any action [PostBack] now on that page, issues the 'Validation of ViewState MAC Failed' error.


Now, I had tried to disable EventViewStateValidation both on a local and global level but it doesn't help.


Any suggestions?

 


Categories: 
ASP.NetWindows Application  .NET Framework  C#  VB.Net  ADO.Net  
Sql Server  SharePoint  Silverlight  Others  All   

Hall of Fame    Twitter   Terms of Service    Privacy Policy    Contact Us    Archives   Tell A Friend