Item with same key already added?

Loopy's avatar

Every time I click on the "recent" link or the "General" forum I get this message. I can click on other forums and have no problem, it's just the General link and the Recent link. Can you decipher what's up with it, Jeff?

Server Error in '/' Application.
An item with the same key has already been added.
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code.

Exception Details: System.ArgumentException: An item with the same key has already been added.

Source Error:

The source code that generated this unhandled exception can only be shown when compiled in debug mode. To enable this, please follow one of the below steps, then request the URL:

1. Add a "Debug=true" directive at the top of the file that generated the error. Example:

<%@ Page Language="C#" Debug="true" %>


2) Add the following section to the configuration file of your application:

<compilation debug="true"/>

Note that this second technique will cause all files within a given application to be compiled in debug mode. The first technique will cause only that particular file to be compiled in debug mode.

Important: Running applications in debug mode does incur a memory/performance overhead. You should make sure that an application has debugging disabled before deploying into production scenario.

Stack Trace:

[ArgumentException: An item with the same key has already been added.]
System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +48
System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +160
System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) +23
PopForums.Data.SqlPopForumsProvider.GetUserTopicLastReadTimes(PopForumsUser user, List`1 topics) in C:\Documents and Settings\Jeff\Desktop\popforums8\PopForums\Data\SqlPopForumsProvider.cs:1535
PopForums.UI.TopicReadIndicator..ctor(PopForumsUser user, List`1 topics) in C:\Documents and Settings\Jeff\Desktop\popforums8\PopForums\UI\TopicReadIndicator.cs:16
TopicListPage.TopicList_TopicItemDataBound(Object sender, TopicListItemEventArgs e) +168
PopForums.UI.TopicList.OnTopicItemDataBound(TopicListItemEventArgs e) in C:\Documents and Settings\Jeff\Desktop\popforums8\PopForums\UI\TopicList.cs:102
PopForums.UI.TopicList.CreateChildControls(IEnumerable dataSource, Boolean dataBinding) in C:\Documents and Settings\Jeff\Desktop\popforums8\PopForums\UI\TopicList.cs:61
System.Web.UI.WebControls.CompositeDataBoundControl.PerformDataBinding(IEnumerable data) +59
System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
Forums_Recent.Page_Load(Object sender, EventArgs e) +234
System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +15
System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +33
System.EventHandler.Invoke(Object sender, EventArgs e) +0
System.Web.UI.Control.OnLoad(EventArgs e) +99
System.Web.UI.Control.LoadRecursive() +47
System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1436

Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433

eat. sleep. ride! - Coaster apparel and accessories!

Ride on, MrScott!

Gomez's avatar

I get the same message every once and a while. Make sure you let the pages load completely before you click on another link.

2008:Magnum XL-200 | Top Thrill Dragster
2007:Corkscrew | Magnum XL-200 | Maverick

Loopy's avatar

No, this is every time I click on the "Recent" link at the top of the forums, no matter if it's first visiting the site or after being here for a while. Same thing for the "General" forum.

eat. sleep. ride! - Coaster apparel and accessories!

Ride on, MrScott!

Loopy's avatar

I decided to click the "Mark all forums read" and after doing that, everything works fine again.Must have been something in the code hanging that tells when a particular forum is read or not.

eat. sleep. ride! - Coaster apparel and accessories!

Ride on, MrScott!

Jeff's avatar

Yeah, I saw the error from the hundred times you tried to get it to load, and I e-mailed you the solution.

The problem is that last night while I was backing up a couple of years worth of log files from various sites on the server, the site slowed down intermittently. In the most unlikely of situations, either you reloaded a page too quickly or some other situation happened where, in a one-in-a-million shot, the database added duplicate records for a page view. When it tried to read them back, it got pissed that there were duplicate records. Marking all of the forums read deleted all of those records.

I guess you're just lucky.

Jeff - Advocate of Great Great Tunnels™ - Co-Publisher - PointBuzz - CoasterBuzz - Blog - Music

You must be logged in to post

POP Forums app ©2023, POP World Media, LLC - Terms of Service