mariolopes
mariolopes

Reputation: 13

ASP.net Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster

I got this error and nothing seems to work to me If I add

    <machineKey validationKey="1234567890123456789012345678901234567890AAAAAAAAAA" 
        decryptionKey="123456789012345678901234567890123456789012345678" 
        validation="SHA1" decryption="Auto" />

got error

An application error occurred on the server. The current custom error settings for this application prevent the details of the application error from being viewed remotely (for security reasons). It could, however, be viewed by browsers running on the local server machine.

If I write

pages validateRequest="false" enableEventValidation="false" viewStateEncryptionMode ="Never"

Does not solve my situation. Here is my system web

  <customErrors mode="Off"/>
  <compilation debug="true" targetFramework="4.5.2" />
  <httpRuntime targetFramework="4.5.2" />

Any help?

Upvotes: 0

Views: 173

Answers (1)

vendettamit
vendettamit

Reputation: 14687

By default Asp.net machine key is auto generated but it can be prevent by explicitly defining the Machine key element in configuration.

Note: The machineKey value has to be the same on all machines in a webfarm/cluster.

Start with this KB for more details for managing Machine keys for farms and clusters deployments.

Update

You can use this online utility to generate the Machine configuration by Machine key.

Upvotes: 1

Related Questions