Copied to clipboard

Flag this post as spam?

This post will be reported to the moderators as potential spam to be looked at


  • Connie DeCinko 931 posts 1159 karma points
    Sep 04, 2013 @ 20:08
    Connie DeCinko
    0

    An item with the same key has already been added.

    After installing this package in Umbraco 6.1.4 and I click into the Developer section, I get the following error:

    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: 
    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: An item with the same key has already been added.]
       System.ThrowHelper.ThrowArgumentException(ExceptionResource resource) +52
       System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +207
       Diplo.TraceLogViewer.DiploTraceLogViewer.GetLogFilesList() in g:\Websites\Umbraco\Base Package\Base Package (v6 MVC)\Diplo.TraceLogViewer\DiploTraceLogViewer.ascx.cs:70
       Diplo.TraceLogViewer.DiploTraceLogViewer.Page_Load(Object sender, EventArgs e) in g:\Websites\Umbraco\Base Package\Base Package (v6 MVC)\Diplo.TraceLogViewer\DiploTraceLogViewer.ascx.cs:18
       System.Web.Util.CalliHelper.EventArgFunctionCaller(IntPtr fp, Object o, Object t, EventArgs e) +14
       System.Web.Util.CalliEventHandlerDelegateProxy.Callback(Object sender, EventArgs e) +35
       System.Web.UI.Control.OnLoad(EventArgs e) +91
       System.Web.UI.Control.LoadRecursive() +74
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Control.LoadRecursive() +146
       System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2207    
    
    --------------------------------------------------------------------------------
    Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.0.30319.272 
    

    If I comment out the package in the Dashboard config the error does not appear.

  • Dan Diplo 1463 posts 5632 karma points MVP 3x c-trib
    Sep 04, 2013 @ 21:49
    Dan Diplo
    0

    Thanks for reporting this, Connie.

    I have tested it with a blank install of 6.14 and it works OK for me. But looking at the error it seems to be occurring at the point in the code were I generate a list of the log files - it uses a Dictionary for this as the logfile names should all have a unique date. The only way I can see this error happening is if two have the same date.

    Could you do me a favour and look in your /App_Data/Logs/ folder - you should see the log files that look like UmbracoTraceLog.txt.2013-09-03 etc. Are there any two that have the same date? Or is there one that has a date that is the same as today's date (04/09/2013) ?

    If possible, could you zip up the entire Logs folder and email it to me so I can perform some tests? My email is dan at diplo dot co dot uk 

    That way I can hopefully diagnose this. Thanks :)

    Dan

     

  • Connie DeCinko 931 posts 1159 karma points
    Sep 04, 2013 @ 21:58
    Connie DeCinko
    0

    I do have two files for one date, the second file is UmbracoTraceLog.txt.2013-08-16-1. I'll change or move it and see if the error goes away.

  • Connie DeCinko 931 posts 1159 karma points
    Sep 04, 2013 @ 22:03
    Connie DeCinko
    0

    That was it, moved that file and now it works.

    Is there a way to change the date format to US date (MM/DD/YYYY)?

  • Dan Diplo 1463 posts 5632 karma points MVP 3x c-trib
    Sep 05, 2013 @ 14:59
    Dan Diplo
    0

    Hi Connie. I thought it must be something like that - in theory Umbraco shouldn't generate two log files for the same date, but I guess something happened that caused this. I'l like at coding around this (rare) possibility in next release.

    To answer your next question:

    "Is there a way to change the date format to US date (MM/DD/YYYY)?"

    The date formatting just uses the standard .NET formatting eg, {0:d}, so should return the format that is right for your current culture (ie. if you are in the UK it should show UK format dates, and if you are in the US it should show US format). If it doesn't then, I'm afraid that is probably down to Umbraco and not something I can change. I have read that Umbraco has some problems with localisation - http://our.umbraco.org/forum/developers/extending-umbraco/8268-Change-date-picker-format-in-Umbraco

Please Sign in or register to post replies

Write your reply to:

Draft