An item with the same key has already been added. Key: VisualBasicValue`1_2

Studio version: 22.10.14

Error “An item with the same key has already been added. Key: VisualBasicValue`1_2” after conversion to Windows.

I can’t run debug on a .xaml file. Unable to start execution with error:

22.10.14+Branch.support-v22.10.Sha.d9bd0105b02c1a4fc6651eed7c4a7dbfba869802

An item with the same key has already been added. Key: VisualBasicValue`1_2

System.ArgumentException: An item with the same key has already been added. Key: VisualBasicValue1_2 at System.Collections.Generic.Dictionary2.TryInsert(TKey key, TValue value, InsertionBehavior behavior)
at System.Linq.Enumerable.ToDictionary[TSource,TKey,TElement](IEnumerable1 source, Func2 keySelector, Func2 elementSelector, IEqualityComparer1 comparer)
at UiPath.Executor.Tracking.ActivityIdsResolver.Register(WorkflowInfo workflowInfo)
at UiPath.Executor.Tracking.DebugTrackingParticipant.RegisterWorkflow(WorkflowInfo workflowInfo)
at UiPath.Executor.DebuggerPlugin.UiPath.Executor.IDebuggerPlugin.RegisterWorkflowTracking(WorkflowInfo workflowInfo)
at UiPath.Executor.Tracking.WorkflowTracking.RegisterWorkflowTracking(WorkflowInfo workflowInfo)
at UiPath.Executor.WorkflowRuntime.RegisterWorkflow(WorkflowInfo workflowInfo)
at UiPath.Executor.RobotRunner.InitWorkflowApplication()
at UiPath.Executor.RobotRunner.ExecuteJob()

Hi @Muhammad_Arief_Syahnakri

Please check the below thread

Regards,

@Muhammad_Arief_Syahnakri,

Can you confirm which activities you are using inside the workflow?

As per error the error occurs when we try to insert duplicate keys in a variable of type dictionary.

You can’t add more than one item in dictionary with same value.

For example

DictionaryVariable("Name")="Ashok"

DictionaryVariable("Name")="Ashok"

This will give you the error you are getting.

You can check if the key is already exists in dictionary and then add like this.

DictionaryVariable.Keys.Exist("Ashok")

@Muhammad_Arief_Syahnakri

As per your error, your automation trying to create duplicate keys in dictionary, use analyze project to get the errors and try to fix then start debugging so that you can know where it is adding duplicate keys in dictionary.
If you are using any config file check your excel whether you given any duplicate keys.