简体   繁体   中英

Validation of viewstate MAC Failed. Machine is NOT on a web farm or cluster

"If this application is hosted by a Web Farm or cluster, ensure the configuration specified the same......"

Ive started to get the above error after moving from an old machine over to another. The application worked perfectly prior to the move and as far as Im aware the new machine is not on a web farm or part of a cluster, but im not sure how to tell exactly. Many posts have suggested I add the machineKey configuration to my web.config which i have done, but this doesn't seem to have resolved the problem.

Is there a way I can tell if my new server is part of a cluster or webfarm?

Many thanks

As far as I know, a lot of reason will cause the "Validation of viewstate MAC Failed" error. Not only your application is running in a server farm. I suggest you could firstly find out your application match which reason and then choose the right solution.

The reason which will cause the error.

1.The web application is running in a farm (multi-server environment) Solution:

2.The worker process uses the IIS 7.0 application pool identity

3.The application pool is configured by using LoadUserProfile=false

4.The Page.ViewStateUserKey property has an incorrect value

A common solution is using an explicit

You could directly use below command in the powershell to generate a new machine key element and add it into the web.config.

Generate-MachineKey

Web.config example:

<configuration>
  <system.web>
    <machineKey ... />
  </system.web>
</configuration>

More details ,you could refer to this article .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM