Answered by:
Validation of viewstate MAC failed problem!

Question
-
User-79977429 posted
Hi
Lately, i've moved my asp.net webApp to new host provider, but some times end user facing this problem :
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
I didn't facing this problem ever! I also refer to this link to work around the problem, but i don't understand how to do that!
Note 1 : I've contact with my hosting provider to give me machineKey (base on what explains in above link, but they told me the Host service is share & could not change some iis properties!)
Note 2 : The control panel of my host is Plesk.
Can anybody help me how to work around this problem?
Thanks in advance
Thursday, May 23, 2019 2:36 PM
Answers
-
User-893317190 posted
Hi hamed_1983,
You could generate a machine key by yourself through iis manager.
https://stackoverflow.com/questions/5840899/asp-net-validation-of-viewstate-mac-failed
If you don't have machine key node in your iis manager , please refer to
To be simple, you could also generate machine key through online service and paste the generated machine in your web.config
https://www.allkeysgenerator.com/Random/ASP-Net-MachineKey-Generator.aspx
It is under system.web node.
<system.web> <machineKey validationKey="7EDB970B683EBC91B512601530D4E3DC95DCCB473D7479101B2223998BF45BCDDF68B01268E5DAE8BDA7B6035F182731541E968818ADF6A62DCCCC8DAED833CC" decryptionKey="243233393F2A55EF6EA3A8B5E30E7EFBF278AD33FFE6BB7399FDDD68F4CE8C8C" validation="SHA1" decryption="AES" />
No matter what way you choose to generate machine key , if you are using web farm , please ensure all your node's web.config have the same machine key.
Best regards,
Ackerly Xu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, May 24, 2019 3:01 AM
All replies
-
User-893317190 posted
Hi hamed_1983,
You could generate a machine key by yourself through iis manager.
https://stackoverflow.com/questions/5840899/asp-net-validation-of-viewstate-mac-failed
If you don't have machine key node in your iis manager , please refer to
To be simple, you could also generate machine key through online service and paste the generated machine in your web.config
https://www.allkeysgenerator.com/Random/ASP-Net-MachineKey-Generator.aspx
It is under system.web node.
<system.web> <machineKey validationKey="7EDB970B683EBC91B512601530D4E3DC95DCCB473D7479101B2223998BF45BCDDF68B01268E5DAE8BDA7B6035F182731541E968818ADF6A62DCCCC8DAED833CC" decryptionKey="243233393F2A55EF6EA3A8B5E30E7EFBF278AD33FFE6BB7399FDDD68F4CE8C8C" validation="SHA1" decryption="AES" />
No matter what way you choose to generate machine key , if you are using web farm , please ensure all your node's web.config have the same machine key.
Best regards,
Ackerly Xu
- Marked as answer by Anonymous Thursday, October 7, 2021 12:00 AM
Friday, May 24, 2019 3:01 AM -