“Validation of viewstate MAC failed. If this application is hosted by a Web Far…”

前端 未结 7 856
悲&欢浪女
悲&欢浪女 2021-01-11 10:07

i am facing the dreaded:

Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the

7条回答
  •  死守一世寂寞
    2021-01-11 11:05

    One thing I have come across that causes this issue has to do with the recycling intervals of the app-pools on the webserver.

    I found this by looking at the event information in Eventviewer/Application logs and the "Task Category" called "Web Event". Then for the time period that this event took place I looked to see if there were any recycled events that took place just before that (Eventviewer/System logs and the "Source" called "WAS".

    By default an app-pool will recycle every 1740 minutes (29 hours). If this recycle happened while a user is busy on the site and send post back to the server, the server no longer recognizes the session/viewstate and rejects what is being posted back.

    To overcome this from our perspective is to set the recycle event to happen at a specific time of the day when we don't expect activity on the site. In our case 3am in the morning.

    Hope that helps someone out there.

提交回复
热议问题