18 Jul 2012
11 Aug 2008
Link to this post
okay while troubleshooting my "an item with the same key has already been added" issue, I discovered what could be a possible bug. I think it could be attributed to user error, but it's something that should be anticipated and handled. here's how I caused the error:
Previous to sitefinity, we had a previous subpage in the form of site.com/subpageA/default.aspx. After moving to sitefinity, we ended up making this a subpage of another group, so that the structure looked like site.com/subpageB/subpageA/default.aspx. since we didn't want to lose users of the previous link, we added the old link site.com/subpageA/default.aspx as an additional url for the new address, redirecting so that they would get forwarded to the correct page.
unfortunately, for whatever reason, we had to put it back the way it was. Rather than deleting the page and creating atl over again, I simply moved the page by dragging it in the sitemap back to its old location. Now the link was site.com/subpageA/default.aspx again. However, since we had already added this as an additional url, it had itself as an additional url, which if I'm not mistaken, should not be allowed. This caused me to get the "same key has already been added" error again reported, but the user would just see a 404 error as if the page didn't exist.
eventually we fixed this by duplicating the page, deleteing the old page, then renaming the new page to the old default.aspx. Now there are no duplication issues, and though we do get that error in other places (still trying to solve that one), we no longer get it in this section.
I would imagine it would be a good idea when a page is dropped in the sitemap to check if it is being dropped into a location mapped by its alternate urls and deleting them before changing the default url so that there are no conflicts.
hope this was helpful!