Tôi có một ứng dụng ASP.NET 2.0 hoạt động tốt trong môi trường cục bộ của chúng tôi. Khi được xuất bản lên máy chủ thử nghiệm, chúng tôi sẽ gặp lỗi liên tục trên máy chủ."Đệm không hợp lệ và không thể xóa" ngoại lệ trên WebResource.axd
Đây là thông dụng phổ biến nhất:
Đệm không hợp lệ và không thể xóa. Mô tả: Một ngoại lệ không được xử lý xảy ra trong khi thực hiện yêu cầu web hiện tại. Vui lòng xem lại dấu vết ngăn xếp để biết thêm thông tin về lỗi và vị trí bắt nguồn từ mã.
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
Điều này xảy ra theo yêu cầu cho yêu cầu WebResource.axd cụ thể.
Các lỗi khác mà chúng ta đang thấy là thế này:
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.
Lỗi này xảy ra thường xuyên trong khi đăng một biểu mẫu.
Bây giờ trước khi bạn nhảy vào và nói với tôi (bình thường) trả lời rõ ràng lỗi này, hãy xem xét điều này:
- Ứng dụng này được triển khai Windows Server 2003 trên IIS6
- Đó là KHÔNG trên web nông trại. Chỉ một máy chủ web được sử dụng tại đây.
- Nhận dạng hồ bơi ứng dụng là tài khoản dịch vụ tùy chỉnh và tôi đã chạy
aspnet_regiss -ga <username>
trên máy chủ. Không có hiệu lực.
Thêm một câu trả lời rõ ràng cho điều này, kiểm tra xem nó ra :) – eglasius
Bất kỳ loại giải pháp nào Ben? Tôi có 15 báo cáo Ngoại lệ trong 25 phút về lỗi đầu tiên bạn báo cáo. Rackspace đã được * cho phép * để khởi động lại đêm qua sau khi cài đặt fx3.5 sp1 và tôi nghĩ rằng đây là từ đó. Tuy nhiên, tôi chỉ phát hiện ra họ "quên" để khởi động lại nó trên mỗi vé của chúng tôi. Đây là liên kết đến một trong các báo cáo của chúng tôi về lỗi - http://exceptioneer.com/Share/Summary.aspx?e5dca865-cb2c-4292-af3f-e9d645a081a7. –
Tôi chưa bao giờ giải quyết vấn đề này. Nó không bao giờ nằm ở đầu danh sách ưu tiên của chúng tôi. Bây giờ tôi đang ở trên một dự án khác, vì vậy ... không có nhiều sự giúp đỡ tôi biết. –