Validation of viewstate MAC failed in Asp.netAsk Questions

 Posted on 18/09/2018 11:32:07 AM

I have an application developed in asp.net 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
profile
Asked by Narendra Shah on 18/09/2018 11:32:07 AM Score: 41 points
Add Comment:
Submit

Comments

1 Answer

1 Corrected Answers
Aproved Answers
2
Profile
Answered by Haresh Chaudhari on Sep 18 2018 1:05PM Score: 261 points
If you are running your asp.net application in a web farm, you should add following key in your web.config file.

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

Another solution is you may generate your machine key on IIS server. View more details here https://support.microsoft.com/en-us/help/2915218/resolving-view-state-message-authentication-code-mac-errors#AppendixA

Hope this will fix your issue.
Add Comment:

Post Your Answer

  •  
  •  

Existing Members

Sign in to your account
Email Address
Password
...or Join us
Download, Vote, Comment, Publish.
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.