- Published on
Validation of viewstate MAC failed
- Authors
- Name
- Steve McNiven
- @stevemcniven
This YSOD has been a pain in my ass for months and I just figured it out!
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:** c:\\Windows\\Microsoft.NET\\Framework\\v4.0.30319\\Temporary ASP.NET Files\\root\\db2b3bd9\\7adc1fcc\\App\_Web\_e5e088a0-e011-4214-b52b-638207e6bf61\_65\_basic.aspx.d63928b6.l8sr6pgw.0.cs **Line:** 0
For “ME” it has nothing to do with setting machine keys in the webconfig, modifying page nodes, etc etc…it was crazy simple.
The masterpage was defined like this
<form id="form1" action="/" runat="server">
The problem is the “action” attribute…change it to this
<form id="form1" runat="server">
Like magic works again.
So this being a masterpage issue I think it’s asp.net related not anything to do with Sitefinity per-say.