ASP.NET 負荷分散 クラスタ構成時に復号化でエラーが出る。
出るエラーはこんな感じ
System.Security.Cryptography.CryptographicException: パディングは無効なので、削除できません。 場所 System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte inputBuffer, Int32 inputOffset, Int32 inputCount, Byte& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) 場所 System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte inputBuffer, Int32 inputOffset, Int32 inputCount) 場所 System.Security.Cryptography.CryptoStream.FlushFinalBlock() 場所 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte buf, Byte[] modifier, Int32 start, Int32 length, IVType ivType, Boolean useValidationSymAlgo) 場所 System.Web.UI.Page.DecryptStringWithIV(String s, IVType ivType) 場所 System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) 場所 System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() 場所 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously)
対応方法
全てのマシンにおいて同一の MachineKey を設定する。
参考リンク