1

I have two websites which are more or less identical, both running on the same server, but under different app pools. The app pools are both configured to run with "NETWORK SERVICE" credentials.

On one website - call this the development copy, I receive the infamous "validation of view state MAC failed" error. This happens when a postback occurs after the page is idle for 20 minutes. I've been informed this is because I don't specify the machine key in the web.config or the machine config file. Manually recycling the app pool reproduces the error as expected. So my question is not about how to stop the issue, but rather I want to know why the error happens in dev but not production. The only difference between the setup of the two sites is the authentication method.

In the "basic settings" section of the IIS config, the dev version of the site is set to connect using a service account, while the production version is using "application user" (pass through authentication). Under authentication settings, both pages are configured with impersonation and windows authentication.

This is the only difference I can see. My knowledge of how IIS handles authentication at the site and app pool level is fairly limited. Is there a specific reason why one setup should result in the machine key being refreshed but the other does not?

Filburt
  • 17,626
  • 12
  • 64
  • 115
Trent
  • 1,089
  • 3
  • 12
  • 24
  • ViewState depends on a session. Are you doing any trickery with sessions that might invalidate (Abandon, Clear) a session prior to a postback? – JDPeckham Mar 21 '13 at 16:01
  • No. And as stated, there is no difference between the code in the two sites. The only difference is the authentication method – Trent Mar 21 '13 at 22:22

1 Answers1

0

After installing .NET 3.5 SP1 you may get Validation of viewstate MAC failed exceptions when doing post backs on ASP.NET pages.

Aghilas Yakoub
  • 28,516
  • 5
  • 46
  • 51