Click here to Skip to main content
15,902,635 members
Please Sign up or sign in to vote.
0.00/5 (No votes)
See more:
After hosting a web site, when accessing two or more members at a time, I get 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. 

Any help with this, is greatly appreciated.
Posted
Updated 6-Apr-12 0:02am
v2

You can turn off this validation by adding EnableViewStateMac="false" to your page directive.
The real question is what's causing the error and you didn't provide much info.
 
Share this answer
 
v2
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” . We looked at the error and realised that we need to create a static machinekey and add it into the web.config of both our IIS7 web servers to fix the issue.
Add following code in web.config.

C#
<machinekey validationkey="AutoGenerate,IsolateApps" decryptionkey="AutoGenerate,IsolateApps">
						validation="SHA1" decryption="Auto" /></machinekey>
 
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