Saturday, March 15, 2014

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.

Today, I got a mail from my client saying that I am getting below error if my session is idle for 1 minute and clicking on any link.

image

I am using shared hosting provider to host my site. To fix that, I have added below part in web.config which I found as easiest solution.

<machineKey validationKey="3BC5E8A45E99DC7D0E99B2B43B175DACBEBA529208650E1162A569E1D91E70CC864E41012913A27B9BF833F43354B07F63F492288EE303A2DF88B18CB8993CEF" decryptionKey="2889DEFAF3354E2F93E8AAC854732F306E3072527B47E0FABA4BF1B987C6DE43" validation="SHA1" decryption="AES" />

I also found a link which is used to generate random machine key.

http://aspnetresources.com/tools/machineKey

No comments:

Post a Comment