Last post Nov 01, 2014 03:25 AM by Jayesh.Dalvi
Oct 28, 2014 02:27 AM|Jayesh.Dalvi|LINK
I have hosted one web site on internet.
But after testing it we come to know that after some ideal time if i try to surf my website it gives below 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.
See http://go.microsoft.com/fwlink/?LinkID=314055 for more information.
I went through this page but don't know where and how to to generate machine key.
Please Help me to solve this error.
Oct 28, 2014 07:27 AM|Siva Krishna Macha|LINK
Have you hosted your application in multiple servers (web farm)? If so, the key used for one machine will be invalid for other machine. So, we need to add machineKey that time.
There are multiple causes in fact.
There is a very good KB article here which explains each cause and the solution for it:
Hope this helps.
Oct 28, 2014 07:34 AM|francissvk|LINK
Your application is hosted in a web farm environment that is multi server environment. In each server, the ASP.Net runtime exists. But the machine key is different between them.
Your first request goes to Server A then the second request handled by Server B. Because of machine key difference, Server B unable to understand it. That's why these kind of error occured.
The above link provides enough information. Also it states the other reasons behind this error.
Oct 29, 2014 01:47 AM|Jayesh.Dalvi|LINK
Hi francissvk ,Siva Krishna Macha, Thanks to answering to my post.
I am using iis and visual studio web server.
But on internet how to make one of the server to stop and to make only one server for use.
Please tell me how to stop one server among this two servers.
Oct 29, 2014 09:30 AM|Siva Krishna Macha|LINK
I hope you hosted your application in some hosting provider environment? If so, hosting provider administrator or support group are the right contact to check with regarding the above activity.
However, if you want to goahead with disable validation (though not recommended if u r using viewstate) or, if you want to generate machineKey and paste in web.config, following discussion should help:
i.e., adding this in <system.web> section of web.config:
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" />
If you generate the machinekey, that should be put in web config similar to below:
<machinekey validation="SHA1" validationkey="A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1B2C3D4E5" decryption="Auto" decryptionkey="A1B2C3D4E5F6F6E5D4C3B2A1A1B2C3D4E5F6F6E5D4C3B2A1" />
Oct 31, 2014 10:22 AM|Siva Krishna Macha|LINK
I've found few more details about this issue and posted in this question:
It could also be due to the page being rendered slowly on a slow network. i.e., if the page is not rendered completely (especially the hidden fields of viewstate), and if the user tries to click on some button in the meantime, then there are chances
of getting this error. There are workarounds to disable and enable the form once all the controls are loaded, etc.
There is a good article explaining this
App pool recycles also may cause this issue,
Also check if there is any virus scanner being run during that time: Reference:
There is another good trouble shooting reference from Microsoft:
I hope, you would get the resolution after going through these notes.
Nov 01, 2014 01:37 AM|Jayesh.Dalvi|LINK
Hi Siva Krishna,
Thanks to reply to my post.
I found information regarding machine.config file where i need to set certain data.
I found it in below path:
But i dont know where to place it online in web site folder.
Please Help !
Nov 01, 2014 03:25 AM|Jayesh.Dalvi|LINK
I got the solution.
add below line in web.config page.
<pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never" >
I am not getting viewstate mac error after adding this to my web.config.