After upgrade umbraco website version 7.2.4 to 7.5.7 i got this error
Server Error in '/' 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.
The issue is that Content Master doctype has two properties with a duplicate property alias. Only the case is different. This shouldn't be the case but didn't cause any issues in prior versions of Umbraco. It is causing the error in 7.5.
This is the query to find the duplicate property alias.
SELECT cct.[alias], [contentTypeId], cpt.[alias], count(cpt.[Alias])
FROM [cmsPropertyType] cpt JOIN [cmsContentType] cct on cpt.contentTypeId = cct.nodeId
GROUP BY cct.[alias], [contentTypeId], cpt.[alias]
HAVING COUNT(cpt.[alias]) > 1
An item with the same key has already been added.
After upgrade umbraco website version 7.2.4 to 7.5.7 i got this error
Server Error in '/' 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) +56 System.Collections.Generic.Dictionary
2.Insert(TKey key, TValue value, Boolean add) +14410285 System.Linq.Enumerable.ToDictionary(IEnumerable
1 source, Func2 keySelector, Func
2 elementSelector, IEqualityComparer1 comparer) +278 Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent.InitializeNode() +3330 Umbraco.Web.PublishedCache.XmlPublishedCache.XmlPublishedContent.get_Path() +27 Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.AddToCacheIfDeepestRoute(UmbracoContext umbracoContext, IPublishedContent content, String route) +190 Umbraco.Web.PublishedCache.XmlPublishedCache.PublishedContentCache.GetByRoute(UmbracoContext umbracoContext, Boolean preview, String route, Nullable
1 hideTopLevelNode) +286 Umbraco.Web.Routing.ContentFinderByNiceUrl.FindContent(PublishedContentRequest docreq, String route) +261 Umbraco.Web.Routing.ContentFinderByNiceUrl.TryFindContent(PublishedContentRequest docRequest) +244 System.Linq.Enumerable.Any(IEnumerable1 source, Func
2 predicate) +179 Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContent() +542 Umbraco.Web.Routing.PublishedContentRequestEngine.FindPublishedContentAndTemplate() +299 Umbraco.Web.Routing.PublishedContentRequestEngine.PrepareRequest() +124 Umbraco.Web.UmbracoModule.ProcessRequest(HttpContextBase httpContext) +452 System.Web.SyncEventExecutionStep.System.Web.HttpApplication.IExecutionStep.Execute() +142 System.Web.HttpApplication.ExecuteStep(IExecutionStep step, Boolean& completedSynchronously) +92Version Information: Microsoft .NET Framework Version:4.0.30319; ASP.NET Version:4.6.1586.0
Seeing the same thing here, following upgrading from 7.4.3 to 7.5.8.
I've tried the "republish entire site" option, but this changes nothing.
What happens when you go to Developer > Health Check tab > "check all groups"?
There was one data integrity issue, which I fixed, but I'm still getting the same exception.
Interesting. Does this help:
https://our.umbraco.org/forum/using-umbraco-and-getting-started/79413-an-item-with-the-same-key-has-already-been-added-umbraco-75
You are a steely-eyed missile man.
Two duplicated aliases. A couple of quick SQL update statements to change the names and my site is back!
Thank you so much!
Glad it worked!
If you could, please mark the answer as resolved.
Cheers
The issue is that Content Master doctype has two properties with a duplicate property alias. Only the case is different. This shouldn't be the case but didn't cause any issues in prior versions of Umbraco. It is causing the error in 7.5.
This is the query to find the duplicate property alias.
SELECT cct.[alias], [contentTypeId], cpt.[alias], count(cpt.[Alias]) FROM [cmsPropertyType] cpt JOIN [cmsContentType] cct on cpt.contentTypeId = cct.nodeId GROUP BY cct.[alias], [contentTypeId], cpt.[alias] HAVING COUNT(cpt.[alias]) > 1
is working on a reply...