Studio: An Item With The Same Key Has Already Been Added

After converting an existing Legacy project to Windows, when trying to run it, the following error is received " An item with the same key has already been added. Key: VisualBasicValue`1_1."

Issue Description: After converting an existing Legacy project to Windows, when trying to run it, the following error is thrown: An item with the same key has already been added. Key: VisualBasicValue`1_1.

Resolution:

  1. Open Main.xaml in a text editor and perform a search (find) for VisualBasicValue`.
  2. Do a Find All in this document to have all the results highlighted.
  3. Multiple results will be returned and each of these should have a unique number (hence the duplicate error). Identify the duplicates and change the value of one of the entries to a value that does not exist already.

Example:

duplicate_VisualBasic.PNG

In this case, the duplicate was for VisualBasic'1_1

And was modified into to 1_7, since this value was not already present in the Main.xaml file.




Read more on the After Windows Conversion: “Unable to start execution: An item with the same key has already been added. Key: VisualBasicValue `1_1 ” .