“An Item with the same key has already been added” is quite a common exception while working with Dictionary object in C#. It arises when you attempt to add a same key to the dictionary object that has a same key. In those cases, you can either update the value corresponding to the key. This can be done as given in the below screenshot.
If you do not want to update your existing Key-Value pairs, you can create a new instance to the Dictionary object and proceed with adding the Key-value pair of your choice. This will also prevent the exception.Please find the screenshot below for more details.
Happy coding folks!