Event code: 3005 - An unhandled exception has occurred

G

Guest

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.RegisterScriptBlock(ScriptKey key,
String script, ListDictionary& scriptBlocks, ArrayList& scriptList, Boolean
needsScriptTags, Boolean& inScriptBlock)
at System.Web.UI.ClientScriptManager.RegisterScriptBlock(ScriptKey key,
String script, ClientAPIRegisterType type)
at System.Web.UI.ClientScriptManager.RegisterClientScriptInclude(Type
type, String key, String url)
at
System.Web.UI.ScriptRegistrationManager.RegisterClientScriptInclude(Control
control, Type type, String key, String url)
at
System.Web.UI.ScriptManager.RegisterClientScriptIncludeInternal(Control
control, Type type, String key, String url)
at System.Web.UI.ScriptManager.RegisterScripts()
at System.Web.UI.ScriptManager.OnPagePreRenderComplete(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
 
W

Walter Wang [MSFT]

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 ([email protected], remove 'online.')
Microsoft Online Community Support

==================================================
Get notification to my posts through email? Please refer to
http://msdn.microsoft.com/subscriptions/managednewsgroups/default.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/subscriptions/support/default.aspx.
==================================================

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

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,836
Messages
2,569,748
Members
45,545
Latest member
rapter____0

Latest Threads

Top