View Full Version : ASP.NET Session Timeout: Viewstate verification failed.

June 16th, 2011, 10:50 AM
This error in the event log can indicate application pool recycling, which causes loss of session information prematurely.

Event message: Viewstate verification failed. Reason: The viewstate supplied failed integrity check.

The cause is usually one of the following:

1. The link or button is not setup correctly.

2. The web.config file for the site does not specify a machinekey. The application was recycled or restarted between the first request and the one generating the error.

Solution: Generate a machinekey, then place this within your web.config file.
This *website creates a machinekey and code for you: http://aspnetresources.com/tools/machineKey

3. The virtual memory for the Application Pool limit.

Solution: While more rare this can be the cause of application pool recycling, causing sessions to be lost. However the solution in #2, will also help fix this issue if not already implemented.

*We do not endorse the site mentioned in this post, use at your own discretion.