Home - Forums-.NET - FlyTreeView (ASP.NET) - System.Security.Cryptography Errors

FlyTreeView (ASP.NET)

Technical support and KB related to the FlyTreeView control

This forum related to following products: FlyTreeView for ASP.NET

System.Security.Cryptography Errors
Link Posted: 03-Aug-2007 09:17
We are getting two errors from out application that don't seem to make much sense.  I have pasted the errors below

Error 1:

Error Message:
Hash not valid for use in specified state.

Stack Trace: at System.Security.Cryptography.CryptographicException.ThrowCryptogaphicException(Int32 hr) at System.Security.Cryptography.Utils._HashData(SafeHashHandle hHash, Byte[] data, Int32 ibStart, Int32 cbSize) at System.Security.Cryptography.MD5CryptoServiceProvider.HashCore(Byte[] rgb, Int32 ibStart, Int32 cbSize) at System.Security.Cryptography.HashAlgorithm.ComputeHash(Byte[] buffer) at NineRays.WebControls.FlyControlCommon`1.ClientRuntimeLoadRenderer.RegisterNonAJAX(ClientScriptManager clientScript, String startupCode) at NineRays.WebControls.FlyControlCommon`1.PreRender() at NineRays.WebControls.FlyTreeView.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

Error 2:

Error Message:
Safe handle has been closed.

Stack Trace:
at System.Security.Cryptography.Utils._HashData(SafeHashHandle hHash, Byte[] data, Int32 ibStart, Int32 cbSize) at System.Security.Cryptography.MD5CryptoServiceProvider.HashCore(Byte[] rgb, Int32 ibStart, Int32 cbSize) at System.Security.Cryptography.HashAlgorithm.ComputeHash(Byte[] buffer) at NineRays.WebControls.FlyControlCommon`1.ClientRuntimeLoadRenderer.RegisterNonAJAX(ClientScriptManager clientScript, String startupCode) at NineRays.WebControls.FlyControlCommon`1.PreRender() at NineRays.WebControls.FlyTreeView.OnPreRender(EventArgs e) at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Control.PreRenderRecursiveInternal() at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)  [/b]
Link Posted: 03-Aug-2007 10:07
When did this begin happening?
What is the version of FlyTreeView control?
Is it new FTV 4.3 beta?
Link Posted: 10-Aug-2007 07:19
Do you still experience the error?

Thanks.
Link Posted: 13-Aug-2007 08:19
We do still get the error.  It is with version 4.1.3.244.  We have gotten it sporradically over time from day one.
Link Posted: 13-Aug-2007 20:11
Version 4.1 does not contain functions you have in Stack Trace.

You can see exact control version in the control DLL file properties window.
Link Posted: 13-Aug-2007 22:15
Today we had some fixes related to ComputeHash and thread safety.
Hope this will help.

It is already available for download at
http://www.9rays.net/download.aspx?productFamily=TreeView_ASP.NET_2
Link Posted: 22-Aug-2007 07:04
You are correct on the version we were using when we get these errors.  We were using version 4.2.1.22.  I had swapped in an older version to see if we go the same errors, which was the 4.1.3.244.  Sorry about the confusion.  I do not get the cryptography errors on version 4.2.1.22 (in fact, the only issue I have with 4.2.1.22 is that the viewstate is huge).  

So, the cryptography errors above are generated from the 4.2.1.22 version.  When I swap in the 4.3.1.8 version, I lose some functionality.  We have a portion of our Website that adds a node dynamically.  When the user clicks on a button, we call a method on the server via AJAX (Anthem) that returns a string to the client.  We then take that string and insert it into the first position of a tree.  

This is the error we get from version 4.3.1.8, I get the following error:

Error Message: Object reference not set to an instance of an object.
Stack Trace: at NineRays.WebControls.FlyTreeView.ApplyStateLog(String stateLog) at NineRays.WebControls.FlyTreeView.System.Web.UI.IPostBackDataHandler.LoadPostData(String postDataKey, NameValueCollection postCollection) at System.Web.UI.Page.ProcessPostData(NameValueCollection postData, Boolean fBeforeLoad) at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
Link Posted: 22-Aug-2007 21:17
Unfortunately, the error info with 4.3.1.8 is not much descriptive.
Could you point on any details that would help us to reproduce the error locally?
May be, just a small test page with the only FlyTreeView control and your modifications that bring control into exception?


Also, we applied a thread-safety patch for cryptography utility from 4.3 to 4.2 version.
It is not available directly through Downloads section of our site.
But I can give you a direct link for the license you own. Just let me know.