Click here to Skip to main content
15,892,517 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
hi,

i hv developed a website but sometimes i got the following viewstate MAC failed error

Server Error in '/' 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: App_Web_xb1xuhdw.6.cs Line: 0
pls tell me why it is and what i shud do to solve it

Thanks
Posted

1 solution

Are you using multiple servers that are load balanced? If yes, then there are two ways to handle this:

1. Set your Load balancer rule so that requests from a specific client always go to the same server (sticky sessions)
2. Set the same machine key on all the servers. (Search "ASP.NET machine key" in google to see how to do this)
 
Share this answer
 

This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)



CodeProject, 20 Bay Street, 11th Floor Toronto, Ontario, Canada M5J 2N8 +1 (416) 849-8900