Server Error in '/TOI/TimesOfIndia' 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 117:        foreach (var sSection in adcContext.Sections.Select(row => row.CorrectName).Distinct())
Line 118:        {
Line 119:            dNames.Add(sSection, NameType.Section);
Line 120:        }
Line 121:

Source File: C:\inetpub\wwwroot\TOI\TimesOfIndia\Sections.aspx.cs    Line: 119

Stack Trace:


[ArgumentException: An item with the same key has already been added.]
   System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +56
   System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +437
   Sections.Init2() in C:\inetpub\wwwroot\TOI\TimesOfIndia\Sections.aspx.cs:119
   Sections..cctor() in C:\inetpub\wwwroot\TOI\TimesOfIndia\Sections.aspx.cs:100

[TypeInitializationException: The type initializer for 'Sections' threw an exception.]
   Sections..ctor() +0
   ASP.sections_aspx..ctor() in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\toi_timesofindia\fc7602fc\cfe31507\App_Web_2jnrhdd4.2.cs:0
   __ASP.FastObjectFactory_app_web_2jnrhdd4.Create_ASP_sections_aspx() in C:\Windows\Microsoft.NET\Framework64\v4.0.30319\Temporary ASP.NET Files\toi_timesofindia\fc7602fc\cfe31507\App_Web_2jnrhdd4.5.cs:0
   System.Web.Compilation.BuildManager.CreateInstanceFromVirtualPath(VirtualPath virtualPath, Type requiredBaseType, HttpContext context, Boolean allowCrossApp) +132
   System.Web.UI.PageHandlerFactory.GetHandlerHelper(HttpContext context, String requestType, VirtualPath virtualPath, String physicalPath) +44
   System.Web.MaterializeHandlerExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +375
   System.Web.HttpApplication.ExecuteStepImpl(IExecutionStep step) +195
   System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +128


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