我有一個在我們的本地環境中工作正常的ASP.NET 2.0應用程序。發佈到測試服務器時,我們在服務器上收到間歇性錯誤。「Padding is Invalid and can not be removed」Exception on WebResource.axd
以下是最常見的:
填充無效且無法刪除。 描述:執行當前Web請求期間發生未處理的異常。請查看堆棧跟蹤以獲取有關該錯誤的更多信息以及源代碼的位置。
Exception Details: System.Security.Cryptography.CryptographicException: Padding is invalid and cannot be removed.
Source Error:
An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.
Stack Trace:
[CryptographicException: Padding is invalid and cannot be removed.]
System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer, Int32 outputOffset, PaddingMode paddingMode, Boolean fLast) +1545747
System.Security.Cryptography.RijndaelManagedTransform.TransformFinalBlock(Byte[] inputBuffer, Int32 inputOffset, Int32 inputCount) +257
System.Security.Cryptography.CryptoStream.FlushFinalBlock() +30 System.Web.Configuration.MachineKeySection.EncryptOrDecryptData(Boolean fEncrypt, Byte[] buf, Byte[] modifier, Int32 start, Int32 length, Boolean useValidationSymAlgo) +164
System.Web.UI.Page.DecryptString(String s) +83
System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext context) +148
System.Web.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +358 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64
這發生在對特定WebResource.axd請求的請求上。
,我們所看到的其他錯誤是這樣的:
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. 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 configuration specifies the same validationKey and validation algorithm. AutoGenerate cannot be used in a cluster.
此錯誤時有發生,同時發佈的形式。
現在你在跳,並告訴我明顯的(通常)回答這個錯誤之前,考慮一下:
- 將應用程序部署到Windows Server 2003上IIS6
- 它不是一個網絡上農場。這裏只有一個網絡服務器正在使用。
- 應用程序池標識是一個自定義服務帳戶,我在服務器上運行
aspnet_regiss -ga <username>
。沒有效果。
已爲此添加了明確的答案,請查看:) – eglasius 2009-03-06 07:50:25
任何類型的解決方案,但本?我在25分鐘內就您報告的第一個錯誤提供了15封Exceptioneer報告。在安裝fx3.5 sp1後,Rackspace被認爲*昨晚重新啓動,我認爲這些都是由此引起的。但是,我發現他們「忘記」根據我們的票證重新啓動它。以下是有關錯誤報告的鏈接 - http://exceptioneer.com/Share/Summary.aspx?e5dca865-cb2c-4292-af3f-e9d645a081a7。 – 2009-12-02 16:26:39
我從來沒有解決過這個問題。它從來沒有在我們的優先列表的頂部。現在我在一個不同的項目上,所以......我知道的幫助並不多。 – 2009-12-03 06:15:38