AJAXControlToolkit, ToolkitScriptManager, string.GetHashCode and mixing 32bit and 64bit machines/processes
Posted by: Eran Sandler, in .NET, AJAX.NET, ASP.NET, Not debugging relatedIf you mix and match 32 bit machines/processes with 64 bit machines/processes in an ASP.NET load balanced environment and you are using the AJAXControlToolkit ToolkitScriptManager class you might end up with the following error:
Message: Assembly “AjaxControlToolkit, Version=1.0.10920.32880, Culture=neutral, PublicKeyToken=28f01b0e84b6d53e” does not contain a script with hash code “9ea3f0e2″.
Stack trace: at AjaxControlToolkit.ToolkitScriptManager.DeserializeScriptEntries(String serializedScriptEntries, Boolean loaded)at AjaxControlToolkit.ToolkitScriptManager.OnLoad(EventArgs e)
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Control.LoadRecursive()
at System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)
The reason is that the request being sent to retrieve the combined javascripts of the control used in the page contains a hash code that is used internally. That hash code is being generated from the script’s name using the default string.GetHashCode function which returns different values for 32 bit and 64 bit processes.
If your 64 bit process creates the javascript include call which contains the 64 bit hash code and the request will eventually reach the 32 bit process/machine you will get this error since the hash value will not be found internally and vice versa.
There is an open issue about this in CodePlex since late January but as of the time of this post, the latest source version in CodePlex doesn’t have a fix for this.








Entries (RSS)
May 27th, 2008 at 4:36 pm
[...] « AJAXControlToolkit, ToolkitScriptManager, string.GetHashCode and mixing 32bit and 64bit machines/pro… 27 05 [...]
June 5th, 2009 at 5:58 pm
What if I am receiving this error in a non-loadtesting environment? I am developing a web site on my own machine, and I get this error using VS 2008’s built-in development server. What could cause this?
June 13th, 2009 at 5:12 pm
Hi Gene, it might be a problem with the AJAXControlToolkit version you are using, if you are indeed using the ToolkitScriptManager class.
I suggest that you upgrade to the latest AJAXControlToolkit version and try again.
Also, make sure you are getting exactly the same error. You can post it here if you like.