Home > Forum > Database > System.ArgumentException: An item with the same key has already been added (version 2025.2.1.42)

System.ArgumentException: An item with the same key has already been added (version 2025.2.1.42)
0

Hi,

I really need your help. We updated Webcon from version 2022 to version 2025 R2 (version 2025.2.1.42).
We started the update from DEV → TEST → PROD (the processes across environments were aligned).
Some issues started appearing on the environments, and we had to introduce modifications.
At this point, when trying to deploy the application from TEST to PROD, I’m getting the following error.
I don’t know where to find the information about which keys are duplicated so I can identify them.
Right now, I can’t transfer from TEST to PROD or from PROD to TEST.

I would be grateful for any suggestions on where to look for information about duplicates and how to resolve this issue.

Import report:
...Import in progress.
...Variables updated.
...An item with the same key has already been added.
...Import interrupted.
Details:
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 System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable`1 source, Func`2 keySelector, Func`2 elementSelector, IEqualityComparer`1 comparer)
at WebCon.WorkFlow.BusinessLogic.ImportExport.LinkedElementsChanger.Exclude()
at WebCon.WorkFlow.BusinessLogic.ImportExport.Import.ImportManager.CreateUnusedRowDeleter(MappingList destMappingList, ImportVerificationResult importVerificationResult, IImportLogger importLogger, TranslationDeletedRelatedElements translationDeletedRelatedElements)
at WebCon.WorkFlow.BusinessLogic.ImportExport.Import.ImportManager.Import(ImportVerificationResult verificationResult, IImportLogger importLogger, IImportExcluderFactory importExcluder, Boolean importAsTemplate, List`1 bpsGroups)
at WebCon.WorkFlow.Service.ActivityExecutors.QueueActivityExecutors.ImportActivityExecutor.DoImport(IImportQueueElement queueElement, List`1 importProgressStudioLog, IActivityEvents activityEvents, ImportExportData importExportData)
at WebCon.WorkFlow.Service.ActivityExecutors.QueueActivityExecutors.ImportActivityExecutor.<ImportActionAsync>d__23.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.ActivityExecutors.QueueActivityExecutors.ImportActivityExecutor.<ImportInLanguageContextAsync>d__22.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.ActivityExecutors.QueueActivityExecutors.ImportActivityExecutor.<<RunAsync>b__21_0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.Activities.ImportActivityFactory.<>c__DisplayClass1_0.<<RunAsync>b__0>d.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.Activities.Activity.<RunAsync>d__49.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.Activities.ImportActivityFactory.<RunAsync>d__1.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.ActivityExecutors.QueueActivityExecutors.ImportActivityExecutor.<RunAsync>d__21.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.Queues.Processors.ProcessorBase`1.<ContextActionAsync>d__44.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.Queues.Processors.ProcessorBase`1.<ProcessingThreadActionAsync>d__43.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw()
at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
at WebCon.WorkFlow.Service.Queues.Processors.ProcessorBase`1.<ThreadActionAsync>d__42.MoveNext()

According to the changelog for version 2025.2.1.138, there was an issue, but I do not know how to work around it.

Fixed an issue that caused the error An item with the same key has already
been added to appear when importing application packages via the import/export
mechanism. The problem occurred when only selected
configuration elements were imported, leading to a database ID collision between
imported and existing records during the cleanup of unused elements.