验证viewstate MAC失败2台服务器

时间:2012-02-02 14:05:38

标签: asp.net

HY 我的.net应用程序应该使用负载均衡器(ARR 2.0)在2台服务器上运行

当我打开两台服务器时,它会带来错误

System.Web.HttpException: Validation of viewstate MAC failed. If this application is hosted by a Web Farm or cluster, ensure that configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster. ---> System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 93.94.223.42 Port: 55263 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0 ViewState: 83e37lsUVLpSrlkP1ZorGYBStXc9fklFg6FgKM24eYeyGam6mWLun1oCux1pV++CQWpMt7yQ4VU1hj/k7030y6kGDF/DPLlrVlEiU+00F2AAIKztr1QxtVa4gE9WUMA3sNCGUOIHdAWaWVpY8BlQmEq4auciGKc9og3blCN4HcE5bACdh0YUM08XxRARPnCsFlMhcDyVLJmcf/pQLbgfF2487lBMTBzfJSmqei4sAe2w8RJ1Htb0DeoZYKsbrPsUTGKaGzw5q5e2HYW+fLKIQRzEEcmI7G30zc0JYscvqAYHk92XOhZv8GVXGgJXyz7BHNQ1Fb+cpU+NEEnMURV/bUYrxjg1KHs+WjDXoX7B1cSxIW3Fxqz2YGQ7HKPDWPyrm9GQHD2jo+aCWkcfGAo/ATMYVYV+SWfbKKJo2bZtM7NFWMYrKef5Bq/cFc0Hu18nj+JlDEyJ90diyw6jJWk2C90q0omXE84XSd3NzKNAKmQfKmdg9MrtAzlSWkHU+s9906iQIMsCjtqxaxB1mO2IdZgsTwKL3Z2PtdnYtIt1QqRBe5/n9bCFQNqxpB4SO0QBNC3Zy8ZlSotJZXSmWCTHj2b1qcykSsE+KSn/i3vzp+Sum3GChGL9z9/TQTho2mfbLnM4GYWuFnlZajk+YbyZh9RSJKvGTQ6pjFHzMQi71EzbidH4zxl2NFFeDbNih34++hjANFp3IzBqwhVoRC6fhIPSim2X8B9pOZhCcn0rcI0Tyxufx7NhtFg7oCvOgVmBAuO60EyP+IIGkJO3wsF5L3iX19g8mLVWwO6KZHt5EyZxMx+GV3k/75hketempI7Bi0dd0UQ0YDz4ByWD5WSBUExXUGqhO1nIGwpjYCqol38HFM6m... ---> System.Security.Cryptography.CryptographicException: Length of the data to decrypt is invalid. at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) --- End of inner exception stack trace --- --- End of inner exception stack trace --- at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPersistenceMedium() at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

StackTrace : at System.Web.UI.ViewStateException.ThrowError(Exception inner, String persistedState, String errorPageMessage, Boolean macValidationError) at System.Web.UI.ViewStateException.ThrowMacValidationError(Exception inner, String persistedState) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) at System.Web.UI.ObjectStateFormatter.System.Web.UI.IStateFormatter.Deserialize(String serializedState) at System.Web.UI.Util.DeserializeWithAssert(IStateFormatter formatter, String serializedState) at System.Web.UI.HiddenFieldPageStatePersister.Load() at System.Web.UI.Page.LoadPageStateFromPersistenceMedium() at System.Web.UI.Page.LoadAllState() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) InnerException : System.Web.UI.ViewStateException: Invalid viewstate. Client IP: 93.94.223.42 Port: 55263 User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:10.0) Gecko/20100101 Firefox/10.0 ViewState: 83e37lsUVLpSrlkP1ZorGYBStXc9fklFg6FgKM24eYeyGam6mWLun1oCux1pV++CQWpMt7yQ4VU1hj/k7030y6kGDF/DPLlrVlEiU+00F2AAIKztr1QxtVa4gE9WUMA3sNCGUOIHdAWaWVpY8BlQmEq4auciGKc9og3blCN4HcE5bACdh0YUM08XxRARPnCsFlMhcDyVLJmcf/pQLbgfF2487lBMTBzfJSmqei4sAe2w8RJ1Htb0DeoZYKsbrPsUTGKaGzw5q5e2HYW+fLKIQRzEEcmI7G30zc0JYscvqAYHk92XOhZv8GVXGgJXyz7BHNQ1Fb+cpU+NEEnMURV/bUYrxjg1KHs+WjDXoX7B1cSxIW3Fxqz2YGQ7HKPDWPyrm9GQHD2jo+aCWkcfGAo/ATMYVYV+SWfbKKJo2bZtM7NFWMYrKef5Bq/cFc0Hu18nj+JlDEyJ90diyw6jJWk2C90q0omXE84XSd3NzKNAKmQfKmdg9MrtAzlSWkHU+s9906iQIMsCjtqxaxB1mO2IdZgsTwKL3Z2PtdnYtIt1QqRBe5/n9bCFQNqxpB4SO0QBNC3Zy8ZlSotJZXSmWCTHj2b1qcykSsE+KSn/i3vzp+Sum3GChGL9z9/TQTho2mfbLnM4GYWuFnlZajk+YbyZh9RSJKvGTQ6pjFHzMQi71EzbidH4zxl2NFFeDbNih34++hjANFp3IzBqwhVoRC6fhIPSim2X8B9pOZhCcn0rcI0Tyxufx7NhtFg7oCvOgVmBAuO60EyP+IIGkJO3wsF5L3iX19g8mLVWwO6KZHt5EyZxMx+GV3k/75hketempI7Bi0dd0UQ0YDz4ByWD5WSBUExXUGqhO1nIGwpjYCqol38HFM6m... ---> System.Security.Cryptography.CryptographicException: Length of the data to decrypt is invalid. at System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) at System.Security.Cryptography.CryptoStream.FlushFinalBlock() at System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) at System.Web.Configuration.MachineKeySection.GetDecodedData(Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Int32& dataLength) at System.Web.UI.ObjectStateFormatter.Deserialize(String inputString) --- End of inner exception stack trace --- 

在两个配置文件中都有相同的配置

<machineKey decryption="AES" decryptionKey="246D7CE6ED5FF3C9EE08ABB3930E61557DB074800580DE07" validation="AES" validationKey="465069FD565CD21C633011564CDDBB676A505C97270C31169AE02BE26459697387B5BC06090428D3A45D2C250B500E258A6B0A80111628E49CE282DFFD28F146" />

0 个答案:

没有答案