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:


Line 42: 		if (!string.IsNullOrWhiteSpace(product.SKU))
Line 43: 			FeaturesTable.Rows.Add(WebObjects.TableRow(new object[] { "<strong>SKU:</strong>", product.SKU }));
Line 44: 		foreach (var size in product.Sizes)
Line 45: 			FeaturesTable.Rows.Add(WebObjects.TableRow(new object[] { string.Format("<strong>{0}:</strong>", size.Key), size.Value.ToString() }));
Line 46: 		FeaturesTable.Visible = FeaturesTable.Rows.Count > 0;

Source File: D:\NonPlatformSites\web03\_Andy_J_Compiled\product-render.aspx.cs    Line: 44

Stack Trace:


[ArgumentException: An item with the same key has already been added.]
   System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +60
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +419
   System.Linq.Enumerable.ToDictionary(IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer) +307
   Product.get_Sizes() +469
   ProductRender.Page_Init(Object sender, EventArgs e) in D:\NonPlatformSites\web03\_Andy_J_Compiled\product-render.aspx.cs:44
   System.Web.UI.Control.OnInit(EventArgs e) +99
   System.Web.UI.Page.OnInit(EventArgs e) +16
   System.Web.UI.Control.InitRecursive(Control namingContainer) +454
   System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +1719


Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.8.4690.0