"“padding is invalid and cannot be removed” exception on webresource.axd" Code Answer


the error is because your appdomain was recycled/restarted. when that happens the application and the machine key is set to auto, it changes. that affects the decryption of the info in the url of the resources urls (.axd). setting up a fixed machine key will prevent it from ever happening again.

please check this for more info on a similar case (the explanation is with an issue with viewstate validation, but the cause is the same one): http://www.developmentnow.com/blog/invalidviewstate+or+unable+to+validate+data+error.aspx

i also had been wondering about it for quite a while. after i saw this question it got me on it again: is this an attempt to break my asp.net site's security? ... which i just answered with very much the same. i had the feeling it was around some restart of something, because when we published something that recycled the application the error showed in the log, but i didn't have any other source stating its relation (today i found that case on invalidviewstate because of the machinekey change :))

ps. above finally explains it on single server :)

By user217929 on May 26 2022

Answers related to ““padding is invalid and cannot be removed” exception on webresource.axd”

Only authorized users can answer the Search term. Please sign in first, or register a free account.