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

User2400 picture User2400 · Jun 9, 2010 · Viewed 40.1k times · Source

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

Answer

User2400 picture User2400 · Jun 14, 2010

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.