Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Welcome To Ask or Share your Answers For Others

Categories

0 votes
890 views
in Technique[技术] by (71.8m points)

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

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

See Question&Answers more detail:os

与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
Welcome To Ask or Share your Answers For Others

1 Reply

0 votes
by (71.8m points)

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.


与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…
OGeek|极客中国-欢迎来到极客的世界,一个免费开放的程序员编程交流平台!开放,进步,分享!让技术改变生活,让极客改变未来! Welcome to OGeek Q&A Community for programmer and developer-Open, Learning and Share
Click Here to Ask a Question

...