+1-888-365-2779
Try Now
More in this section

Forums / Bugs & Issues / [ArgumentException: An item with the same key has already been added.]

[ArgumentException: An item with the same key has already been added.]

3 posts, 0 answered
  1. Dennis
    Dennis avatar
    16 posts
    Registered:
    10 Aug 2012
    19 Aug 2009
    Link to this post
    Hi, a site is throwing the above error on the contact page and:

    Property accessor 'CategoriesTreeView' on object 'Telerik.Cms.Engine.WebControls.Categories.CategoriesTree' threw the following exception:'The type initializer for 'Telerik.Framework.Web.ControlUtils' threw an exception.'

    on another page.

    When loggin into the admin the same error as the title appears:

    [ArgumentException: An item with the same key has already been added.]

    The site has not changed form last night when I edited some blog templates and was working fine afterwards. I also changed the Telerik.Sitefinity.Configuration.ControlsConfig.xml by adding a new template. I upoaded the original file before incase that was the error.

    I am a very new Sitefinity user and the site is hosted on a shared server (Server2003, HSphere CP, ASP.NET 3.5 and Sitefinity 3.6.1936.3)

    Help!!
  2. Dennis
    Dennis avatar
    16 posts
    Registered:
    10 Aug 2012
    19 Aug 2009
    Link to this post
    Phew! I seem to have found the error. I added an extra line to the App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml file creating two entries for the same template. Even though they were different ascx controls because the "Telerik.Blogs.WebControls.BlogPosts" was referencing twice, there wes the error.

    I found out that sometimes configuration settings need an IIS refresh before they activate and therefore my changes last nigth didn't effect the site until today. After I uploaded the back up ControlsConfig.xml file it took a while for the error to dissapear.

    Well at least that is what I think happened so I am posting this reply so if any other newbe  has the same trouble on shared hosting and the changes to the ControlsConfig.xml file
  3. Parvan
    Parvan avatar
    151 posts
    Registered:
    24 Sep 2012
    19 Aug 2009
    Link to this post
    Hi Dennis,

    We are glad to hear you managed to resolve the issue.
    Here you can find more information about the configuration file and external templates - Introduction to ControlsConfig file.
    Also you are right - you need to refresh the application in order changes in App_Data/Configuration/Telerik.Sitefinity.Configuration.ControlsConfig.xml to take effect. One easy way to do so is making dummy change in project's web.config file and save it.

    I hope this helps you.

    Best wishes,
    Parvan
    the Telerik team

    Instantly find answers to your questions on the new Telerik Support Portal.
    Check out the tips for optimizing your support resource searches.
Register for webinar
3 posts, 0 answered