By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
424,984 Members | 1,421 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 424,984 IT Pros & Developers. It's quick & easy.

Event code: 3005 - An unhandled exception has occurred

P: n/a
Hello

I have an ASP.NET 2 intranet application written in C#. I use Active
Directory authentication and parts of the application uses AJAX.

From time to time (about once every 200-300 accesses at least) I get the
following error on the server:

Event code: 3005
Event message: An unhandled exception has occurred.
....
Exception information:
Exception type: ArgumentException
Exception message: An entry with the same key already exists.
....
Thread information:
Thread ID: 5
Thread account name: NT AUTHORITY\NETWORK SERVICE
Is impersonating: False
Stack trace: at
System.Collections.Specialized.ListDictionary.Add( Object key, Object value)
at System.Web.UI.ClientScriptManager.RegisterScriptBl ock(ScriptKey key,
String script, ListDictionary& scriptBlocks, ArrayList& scriptList, Boolean
needsScriptTags, Boolean& inScriptBlock)
at System.Web.UI.ClientScriptManager.RegisterScriptBl ock(ScriptKey key,
String script, ClientAPIRegisterType type)
at System.Web.UI.ClientScriptManager.RegisterClientSc riptInclude(Type
type, String key, String url)
at
System.Web.UI.ScriptRegistrationManager.RegisterCl ientScriptInclude(Control
control, Type type, String key, String url)
at
System.Web.UI.ScriptManager.RegisterClientScriptIn cludeInternal(Control
control, Type type, String key, String url)
at System.Web.UI.ScriptManager.RegisterScripts()
at System.Web.UI.ScriptManager.OnPagePreRenderComplet e(Object sender,
EventArgs e)
at System.Web.UI.Page.OnPreRenderComplete(EventArgs e)
at System.Web.UI.Page.ProcessRequestMain(Boolean
includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint)

The page that is throwing this error has an AJAX tab control in it, uses a
master page and has the usual sprinkling of asp.net controls. There is no
code behind on the page.

Any ideas on why I'm getting this error, or a pointer in the right
direction, would be much appreciated.

Zinon
Jun 11 '07 #1
Share this Question
Share on Google+
1 Reply


P: n/a
Hi Zinon,

I've used Reflector (http://www.aisto.com/roeder/dotnet/) to check the
ClientScriptManager.RegisterScriptBlock, and found the code is like
following:

if (scriptBlocks == null)
{
scriptBlocks = new ListDictionary();
}
if (scriptBlocks[key] == null)
{
scriptBlocks.Add(key, script);

This means the only possible cause that might throw an "An entry with the
same key already exists" will be that there's already an item in the
scriptBlocks that has null value:
ListDictionary dict = new ListDictionary();
object key = GetType();
dict.Add(key, null);
if (dict[key] == null)
{
dict.Add(key, "Hello");
}
Please check if your code might be passing a null script block to those
functions that are used to register script blocks.

If in doubt, please feel free to post more code of your WebForm. Thanks.
Sincerely,
Walter Wang (wa****@online.microsoft.com, remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscripti...ult.aspx#notif
ications. If you are using Outlook Express, please make sure you clear the
check box "Tools/Options/Read: Get 300 headers at a time" to see your reply
promptly.

Note: The MSDN Managed Newsgroup support offering is for non-urgent issues
where an initial response from the community or a Microsoft Support
Engineer within 1 business day is acceptable. Please note that each follow
up response may take approximately 2 business days as the support
professional working with you may need further investigation to reach the
most efficient resolution. The offering is not appropriate for situations
that require urgent, real-time or phone-based interactions or complex
project analysis and dump analysis issues. Issues of this nature are best
handled working with a dedicated Microsoft Support Engineer by contacting
Microsoft Customer Support Services (CSS) at
http://msdn.microsoft.com/subscripti...t/default.aspx.
==================================================

This posting is provided "AS IS" with no warranties, and confers no rights.

Jun 12 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.