Generating sitemap gives an error: System.ArgumentException: An item with the same key has already been added
Sitefinity in 8.2.5.9 version:
When we try to generate the sitemap.xml in Administration / Settings / Sitemap nothing appears to be generated and it gives us the error below in log (it is also added to the SitemapConfig.config file):
In log as we can see:
Message: System.ArgumentException: An item with the same key has already been added.
at System.ThrowHelper.ThrowArgumentException(ExceptionResource resource)
at System.Collections.Generic.Dictionary`2.Insert(TKey key, TValue value, Boolean add)
at Telerik.Sitefinity.SitemapGenerator.Impl.SitemapCrawler.GetPageRels(PageNode page, ISite site)
at Telerik.Sitefinity.SitemapGenerator.Impl.SitemapCrawler.GetPageEntries(ISite site, Int32& count, SitemapScheduledTask task)
at Telerik.Sitefinity.SitemapGenerator.Impl.SitemapCrawler.GetEntries(Guid siteId, SitemapScheduledTask task)
at Telerik.Sitefinity.SitemapGenerator.SitemapManager.Start(Guid siteId, SitemapScheduledTask task)
How can we avoid this to happen?
Also if it has more than one file, or duplicated in Administration > User Files > System we can't find any of XMLSitemapGeneratorLibrary item indeed.