0
votes

I have a pool of 2 servers for an ASP.Net WebForms application, 1 of which is 2k3 and 1 newly added which is 2k8 R2. I have configured my application to always encrypt the viewstate e.g.

<pages enableViewState="false" validateRequest="true" viewStateEncryptionMode="Always"/>

The machine.config has been set on the servers to be both the same encryption/decrpytion algorithms and keys. I have a Load Balancer distributing traffic across the boxes and when an initial request from one server posts back to the other I get the following exception:

System.Web.HttpException: 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

I have tried setting the machineKey element in the web.config at the application level but I get the same issue. Is this error in any way down to IIS or O/S differences?

2

2 Answers

0
votes

you can generate machine key from developersfusion and add it to your web.config.

0
votes

We managed to get rid of this issue by applying all outstanding Windows Update hotfixes/patches to the 2003 server. This involved a number of .Net 2.0 framework updates.