VS2010“已添加具有相同密钥的项目” [英] VS2010 "An item with the same key has already been added"
问题描述
我最近安装了Visual Studio 2010并将旧的VS2005解决方案复制并转换为VS2010
I recently installed Visual Studio 2010 and copied and converted an old VS2005 solution to VS2010
当我编辑此解决方案时,如果我尝试更改控件的.image属性,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.
我可以为任何其他解决方案添加图像,甚至是从VS2005移植的其他解决方案,但不是这个。知道我做错了吗?
I can add images for any other solution, even others ported from VS2005, but not this one. Any idea what I'm doing wrong?
一个项目已经添加了相同的密钥。 http://img121.imageshack.us/img121/3592/errorsy.jpg
推荐答案
我解决了这个问题感谢搜索。解决方案是永远不要创建名为Resources.resx的.resx文件,因为它与可以在项目属性对话框中自动创建的Resources.resx文件冲突。
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.
一旦我将Resources.resx重命名为Icons.resx,我就可以更改解决方案中任何内容的图像属性。
Once I renamed Resources.resx to Icons.resx, I was able to change the image property for anything in the solution.
这篇关于VS2010“已添加具有相同密钥的项目”的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!