Visual Studio错误:具有相同键的项已被添加 [英] Visual Studio Error: An item with the same key has already been added
问题描述
当我尝试在窗体设计器中更改Windows窗体上的默认控件图像 时(无论在哪个控件上),都会出现此错误:
When I'm trying to change the default Image of a Control on Windows Forms in Form Designer (no matter where on which control) I get this error:
错误消息:具有相同项目 密钥已经添加
Error message: An item with the same key has already been added
我试图删除并重新创建 Resources.resx 文件.工作.
I tried to delete and recreate the Resources.resx file.. I assured that only 1 resx file with these keys exist.. (in fact that's my only resource file) but it still does not work.
我有som字符串和一些图像.就是这样.
I have som strings in it and some images. That's all.
有什么主意吗?
推荐答案
I had this problem too. 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",您应该可以完美地更改图像.
Just right-click and rename the "Resources.resx" and you should be able to change images perfectly.
这篇关于Visual Studio错误:具有相同键的项已被添加的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!