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

Forums / Bugs & Issues / Error on almost every page - An item with the same key has already been added.

Error on almost every page - An item with the same key has already been added.

17 posts, 0 answered
  1. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    17 Oct 2008
    Link to this post
    I have a 3.5 site that was upgraded from version 3.1. Now on almost every page I am getting "An item with the same key has already been added." errors.

    Server Error in '/IPI' 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: 
     
    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) +48 
       System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add) +2668392 
       System.Collections.Generic.Dictionary`2.Add(TKey key, TValue value) +11 
       Telerik.Cms.Web.CmsSiteMapProvider.CacheNode(ICmsPage page, CmsSiteMapNode parentNode) +540 
       Telerik.Cms.Web.CmsSiteMapProvider.GetUrlContext(String url, Boolean skipSvcs) +923 
       Telerik.Cms.Web.UrlHelper.GetUrl(String url, Boolean skipSvcs) +44 
       Telerik.Cms.Web.CmsHttpModule.BeginRequest(Object sender, EventArgs e) +1146 
       System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +92 
       System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +64 
     
     
    Version Information: Microsoft .NET Framework Version:2.0.50727.1433; ASP.NET Version:2.0.50727.1433  

  2. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    17 Oct 2008
    Link to this post
    Some more information. I added a new index since there were none. It solved the problem temporarily. I went to duplicate a master page, and added a site site menu control from the navigation section, set the StartingNodeOffset to 1, clicked I'm done, and that's when the problems started again. I think the culprit is:
    Telerik.Cms.Web.CmsSiteMapProvider.CacheNode(ICmsPage page, CmsSiteMapNode parentNode) +540

  3. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    17 Oct 2008
    Link to this post
    Adding a site menu to the master page results in the error below. I do not know if having a script manager in the master page is playing a role here.

    Object reference not set to an instance of an object.

    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.NullReferenceException: Object reference not set to an instance of an object.

    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:

    [NullReferenceException: Object reference not set to an instance of an object.]
    Telerik.Cms.Web.CmsSiteMapProvider.CacheNodes(SiteMapNode parentNode) +250
    Telerik.Cms.Web.CmsSiteMapProvider.GetChildNodes(SiteMapNode parentNode) +79
    System.Web.SiteMapNode.get_ChildNodes() +23
    System.Web.UI.WebControls.SiteMapDataSource.GetNodes() +624
    System.Web.UI.WebControls.SiteMapDataSource.GetTreeView(String viewPath) +32
    System.Web.UI.WebControls.SiteMapDataSource.GetHierarchicalView(String viewPath) +29
    System.Web.UI.HierarchicalDataSourceControl.System.Web.UI.IHierarchicalDataSource.GetHierarchicalView(String viewPath) +7
    Telerik.Web.UI.DecoratingDataSource.System.Web.UI.IHierarchicalDataSource.GetHierarchicalView(String viewPath) +10
    Telerik.Web.UI.HierarchicalControlItemContainer.GetHierarchyData(IEnumerable data) +70
    Telerik.Web.UI.HierarchicalControlItemContainer.PerformDataBinding(IEnumerable data) +381
    System.Web.UI.WebControls.DataBoundControl.OnDataSourceViewSelectCallback(IEnumerable data) +111
    System.Web.UI.DataSourceView.Select(DataSourceSelectArguments arguments, DataSourceViewSelectCallback callback) +29
    System.Web.UI.WebControls.DataBoundControl.PerformSelect() +149
    System.Web.UI.WebControls.BaseDataBoundControl.DataBind() +70
    System.Web.UI.WebControls.BaseDataBoundControl.EnsureDataBound() +82
    System.Web.UI.WebControls.BaseDataBoundControl.OnPreRender(EventArgs e) +19
    Telerik.Web.UI.RadDataBoundControl.OnPreRender(EventArgs e) +9
    System.Web.UI.Control.PreRenderRecursiveInternal() +86
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Control.PreRenderRecursiveInternal() +170
    System.Web.UI.Page.ProcessRequestMain(Boolean includeStagesBeforeAsyncPoint, Boolean includeStagesAfterAsyncPoint) +2041

  4. Eric
    Eric avatar
    23 posts
    Registered:
    01 Aug 2007
    17 Oct 2008
    Link to this post
    Don't mean to be talking to myself here. lol. I tried starting with a blank 3.5 project and a fresh database. After setup, I went and duplicated the master page, dragged a site menu control onto the page. Went to edit the site menu control, set the StartingNodeOffset to 1, clicked "I'm Done", and was able to reproduce the error above (Object Reference).
  5. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    20 Oct 2008
    Link to this post
    Hello Eric,

    We are aware of these errors - they are all related. We will provide a fix in several days within a service pack. It will also fix several other problems with the RadControls.

    Please accept our apologizes for the inconvenience.

    Regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  6. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    18 Nov 2008
    Link to this post
    We are still getting the, "An item with the same key has already been added.", error message after upgrading a 3.5 site to 3.5 SP1. I have tried to get a fresh project to produce the same error, but no luck.

    The page getting this error is an existing child page of a group page. We duplicated the page, saved the changes and published. Then we moved the duplicated page to another group page. After selecting the moved page and editing the page, upon submission or canceling the error appears.

    I thought that maybe before editing the page I should re-index the site. I tried this and I still get the error. Not sure if this has anything to do with it being an upgrade from the first release to SP1 or not.
  7. Richard Baugh
    Richard Baugh avatar
    201 posts
    Registered:
    22 Aug 2012
    18 Nov 2008
    Link to this post
    I think we pinpointed it to the site is using an old path separator other than a slash. We added another url to the page by duplicating the current url and changing the path separator. The errors seem to have disappeared.
  8. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    30 Dec 2008
    Link to this post
    Hi Richard,

    I'm having exactly the same error, could you explain how you rectified this issue temporarily until Telerik comes up with a fix.

    @Georgi - Please let us all know when the fix for this is going to be available, we have to go live with our website and everything was fine until very recently when this error started appearing on each and every page. please help

    Thanks,
  9. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    30 Dec 2008
    Link to this post
    Oh sorry I meant I get the same error as Eric and not Richard.

    Anyone know how to fix it ? temporarily even. The weird thing is that I'm able to see the complete sitemap on my development box but when the same is deployed to the testing server, it fails miserably.
  10. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    30 Dec 2008
    Link to this post
    Hi Zubair,

    The fix we were talking about was included in Sitefinity 3.5SP1. Actually, looking at the exception you provided in the other thread, I believe that the problem is different. We will try to answer you there as soon as possible since there is more information in that thread.

    Greetings,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  11. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    30 Dec 2008
    Link to this post
    Yes please do so, we have put static nav on all our pages for now since it's being reviewed.
  12. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    30 Dec 2008
    Link to this post
    Ok, I just sent you the details to download the files. Please check
  13. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    30 Dec 2008
    Link to this post
    Hello Zubair,

    We have the details needed. We will provide you a suggestion or comment shortly.

    Sincerely yours,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
  14. Mikael Kleinwort
    Mikael Kleinwort avatar
    78 posts
    Registered:
    17 May 2004
    31 Dec 2008
    Link to this post
    I have the same error in this scenario: I have uploaded a master page, and a secondary master page which has the first master page as a master (nested master pages).

    When I want to edit the template which is based on the master pages, all is fine.

    When I want to edit the template which is based on the secondary master page, I get the "An item with th same.." error.

    I removed any references to RadControls directly in the master files but the error persists.

    I need help please :-)

    Mikael
  15. Mikael Kleinwort
    Mikael Kleinwort avatar
    78 posts
    Registered:
    17 May 2004
    03 Jan 2009
    Link to this post
    I solved the mystery of the error reported by me in the previews post. The main master file and the child master file had content placeholder controls with similar ids. After I renamed the controls so they are no similar control ids in the 2 master files, the error went away. I posted a separate bug report about this.

    Regards, Mikael
  16. Zubair
    Zubair avatar
    142 posts
    Registered:
    26 Dec 2007
    04 Jan 2009
    Link to this post
    Hello Georgi, any news on this issue.
  17. Georgi
    Georgi avatar
    3583 posts
    Registered:
    28 Oct 2016
    05 Jan 2009
    Link to this post
    Hi Zubair,

    Please follow up in the support thread and keep any further communication about this problem in it.

    Mikael,
    Thank you for your follow up! We will look into the other thread.

    Kind regards,
    Georgi
    the Telerik team

    Check out Telerik Trainer, the state of the art learning tool for Telerik products.
Register for webinar
17 posts, 0 answered