Ok, I have an internal intranet website created in visual studio 2005, c#.
It was running fine for months, and then all of the sudden a few days I
started getting these errors emailed to me (I have it set up to email me
exceptions). Here is the error. I have gotten this error probably 100 times
in the last 2 days.
I have googled this error to no avail. My program is not doing any
decrypting, I am not on a web farm, I have reset the web server. The website
is internal, not on internet.
Exception Thrown
Module:
http://intranet/WebResource.axd?d=_9PVU2juk255_dSftXLwlg2&t=632967410635716438
Exception Information: System.Security.Cryptography.CryptographicException:
Padding is invalid and cannot be removed.
at System.Security.Cryptography.RijndaelManagedTransform.DecryptData(Byte[]
inputBuffer, Int32 inputOffset, Int32 inputCount, Byte[]& outputBuffer,
Int32 outputOffset, PaddingMode paddingMode, Boolean fLast)
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, Boolean
useValidationSymAlgo)
at System.Web.UI.Page.DecryptString(String s)
at
System.Web.Handlers.AssemblyResourceLoader.System.Web.IHttpHandler.ProcessRequest(HttpContext
context)
at
System.Web.HttpApplication.CallHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute()
at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
completedSynchronously)
bruce barker - 12 Jul 2007 17:16 GMT
WebResource.axd is a builtin handler that returns resource strings.
asp.net returns javscript and builtin images this way. to keep anyone
from reading any resource string, you pass an encrypted request args
(there is an api to generate this).
because the encryption key is regenerated at startup, a recycle can
cause this error. check the error log for recycle events.
-- bruce (sqlwork.com)
> Ok, I have an internal intranet website created in visual studio 2005, c#.
> It was running fine for months, and then all of the sudden a few days I
[quoted text clipped - 39 lines]
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously)
Peter Bromberg [C# MVP] - 12 Jul 2007 17:30 GMT
The way to solve this issue (mandatory if on a web farm) is not to use the
"autogenerated=true" attribute in the machineKey element. Generate your own
keys and have them specified, they must be the same on every machine.
-- Peter
Site: http://www.eggheadcafe.com
UnBlog: http://petesbloggerama.blogspot.com
BlogMetaFinder(BETA): http://www.blogmetafinder.com
> Ok, I have an internal intranet website created in visual studio 2005, c#.
> It was running fine for months, and then all of the sudden a few days I
[quoted text clipped - 39 lines]
> at System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean&
> completedSynchronously)