Validation of viewstate MAC failed in Asp.netAsk Questions

 Posted on 09/18/2018

I have an application developed in 4.5. When site loaded on browser, I reload it or click on any link or button, it give me following 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.

Can anyone tell me the solution for this?

Thanks in advance.

Share On: facebook gplus twitter
Asked by Narendra Shah on 09/18/2018 Score: 95 points
Add Comment:


1 Answers

1 Corrected Answers
Aproved Answers
Answered by Haresh Chaudhari on 9/18/2018 1:05:15 PM Score: 255 points
If you are running your application in a web farm, you should add following key in your web.config file.

<machineKey  decryptionKey="2CC8E5C3B1812451A707FBAAAEAC9052E05AE1B858993660" validation="HMACSHA256" decryption="AES" validationKey="CB8860CE588A62A2CF9B0B2F48D2C8C31A6A40F0517268CEBCA431A3177B08FC53D818B82

Another solution is you may generate your machine key on IIS server. View more details here

Hope this will fix your issue.


Add Comment:

Post Your Answers

Existing Members

Sign in to your account
Email Address
New Member?
Sign up and complete profile
Full Name
Email Address
I have read and agree to the Terms of Service and Privacy Policy
Please subscribe me to the StoodQ newsletters
Guideline to answer a question:

Useful tips to submit your answer
Please read below guidelines before you submit your answer for question.

  • Read and understand question for which you are submitting your answer.
  • Try to avoid grammatical and spell mistake while answering.
  • Do not post any irrelevant information in your answer.
  • Explain your answer with example or any reference link to help who posted question.
  • If you find irrelevant question, please report it to support. Click here to contact support.
  • You agree to the privacy policy and terms of use to submit any contents.

Note: StoodQ is online developers community which helps developer for their difficulty, lets help them with your value contribution.