0

私のサイトは負荷分散 (合計 4 サーバー) 環境の Web ファームでホストされていますが、一部のクライアントで以下のエラーが発生しています。

Server Error in '/' Application.
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.

**Description**: An unhandled exception occurred during the execution of the current web
request. Please review the stack trace for more information about the error and where it
originated in the code.

**Exception Details**: 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.

ただし、私の 4 つのサイトのそれぞれで、web.config ファイルに以下のマシンキーがありますが、まだ問題が発生しています。

<machineKey
    validationKey="3B1107F98F6E4ECD868C929C0826C3845058F39B5113CD7E676170F4DBE4D65D83C65BCB166FFFB7F2749214C0CA503D04A956C1681F56C63A2B5D9F5F4B04FC"
    decryptionKey="3565248537BB78D03CCA78A2E8C757451EDCFD3D7AAE6199420FEE692158B37F"
    validation="SHA1" decryption="AES"
    />

何かアドバイスはありますか?ありがとう

4

1 に答える 1

-1

ここから取っていますValidation of viewstate MAC failed- Server Error in '/' Application .

<pages enableEventValidation="false" viewStateEncryptionMode="Never">

上記のソリューションの問題は、セキュリティをいくらか犠牲にすることです。次の「簡単な修正」は、web.config に以下を追加することですが、これにも欠点があります。

<pages enableViewStateMac="false">

上記のコードは両方とも問題を解決できます。

于 2012-10-16T10:17:53.727 に答える