Solution-Validation of viewstate MAC failed. - ASP TANMOY

Latest

Tuesday 28 July 2015

Solution-Validation of viewstate MAC failed.

You have hosted a website and its running well. But you notice that if you do not do anything to your website then your website is showing a server application error i.e Validation of viewstate MAC failed. The error definition is given bellow.
Server Error in Application.

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure thatconfiguration 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 configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.


  Now  what  you will do?

Solution:

Step 1: go to your config file(web.config). And open it.
Step 2:  find <system.web>Step 3: copy the following code and peste the code just bellow of <system.web>

Code:

 <machineKey validation="SHA1" validationKey="A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1B2C3D4E5" decryption="Auto" decryptionKey="A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1" />

Save the file and run the website again.


No comments:

Post a Comment