Looking for the v10 manual? Visit our new user's guide!
 
Search Descriptions Version
 
 
This article applies to: ML v7, ML8, MultiStore

Item has already been added. Key in dictionary: 'addtocart' key being added.


Symptoms
Server error in '/' Application.
Item has already been added.  Key in dictionary: 'addtocart' Key being added: 'addtocart'
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: Item has already been added.  Key in dictionary: 'addtocart' Key being added: 'addtocart'

Source Error:

An unhandled exception was generated during the execution of the current web request.  Information regarding the origin and location of the exception can be identified using the exception stack trace below.

Stack Trace:

[ArgumentException: Item has already been added.  Key in dictionary: 'addtocart' Key being added: 'addtocart'] System.Collections.SortedList.Add(Object key, Object value) +7501255 AspDotNetStorefrontCommon.AspdnsfEventHandlers..ctor() in C:\ASPDNSF\Builds\ML7100CSharp\ASPDNSFCommon\TaxClass.cs:192 AspDotNetStorefront.Global.L0AYPBkHQ() +704 AspDotNetStorefront.Global.eVEX1Eabb(Object, EventArgs) +408 AspDotNetStorefront.Global.Application_BeginRequest(Object sender, EventArgs e) +68

System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +68 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +75

Cause
You're not allowed to have more than 1 event handler with the same name in 'addtocart', and you will get this error if more than one with the same name exists.

Solution
Check the dbo.EventHandler table for event handlers with the name 'addtocart' and remove the duplicate value.

More Information
This error also occurs to any AppConfig Parameters that have duplicate values such as 3DSecure.CreditCardTypeID, etc.