Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

VS2010 "An item with the same key has already been added"

Tags:

I recently installed Visual Studio 2010 and copied and converted an old VS2005 solution to VS2010

When I edit this solution, if I try to change a control's .image property, VS2010 creates a message box telling me that "An item with the same key has already been added" (screenshot below), and won't let me browse for an image.

I can add images for any other solution, even others ported from VS2005, but not this one. Any idea what I'm doing wrong?

An item with the same key has already been added. http://img121.imageshack.us/img121/3592/errorsy.jpg

like image 894
User2400 Avatar asked Jun 09 '10 07:06

User2400


1 Answers

I worked this out thanks to a search. The solution is to never create a .resx file with the name "Resources.resx" because it conflicts with the "Resources.resx" files that can be automatically created in the project's properties dialog.

Once I renamed Resources.resx to Icons.resx, I was able to change the image property for anything in the solution.

like image 146
User2400 Avatar answered Sep 25 '22 17:09

User2400