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

Good afternoon UiPath Forum,

I am following up on a post response by @Yoichi related to the topic by this same name. I am experiencing the same issue but the immediate panel doesn’t present the source within the Project that is causing this. I have seen a few posts that demonstrate a few different reasons for this issue. However, what I really need is to spot the place in the Project where this occurs. The error I am seeing is this and the project in question is built using the ReFramework. It looks like the load of a Dictionary variable. There also seems to be an issue with the formatting of a single quote. Is there a way to step from this error messaging into my Project and find the activity that is triggering this?

System.ArgumentException: An item with the same key has already been added. Key: VisualBasicValue1_1 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()

@jamiejam

This was happing for a few of the projects after convert to windows
Can you open the Main.xaml file in Notepad and search for VisualBasicValue`1_1
If you found two then you can replace one 1_1 to 1_2

I assume that this is happening when we are copy pasting the activities that where the same key was there and manually setting like above it resolves the issue

Hope this may help you

Thanks,
Srini

Hi @jamiejam - Can you please check the below link

An item with the same key has already been added. Key: VisualBasicValue`1_1 after windows conversion - Help / Studio - UiPath Community Forum

I used the same key for reference. My apologies. I did get an excellent answer that solved my issue so thanks to the Forum once again.

Good afternoon @ushu. Thanks very much for the fast response. I tried this but it did not fix my issue. Errors were same. The approach that did fix my issue was addressed by @lucas.stern and @savantsa in a separate post.

Solution found here.

An item with the same key has already been added. Key: VisualBasicValue`1_1 after windows conversion - Help / Studio - UiPath Community Forum

That addresses only part of the reasons.