无效的Resx而在用户控件使用集合 [英] Invalid Resx while using collection in usercontrol
问题描述
我创建了vb.net的WinForms一个用户控件,有一个字典财产。我收到以下错误消息:
I created a usercontrol in vb.net winforms that has a Dictionary as property. I am getting the following error message:
错误1无效的Resx文件。未能加载类型 System.Collections.Generic.Dictionary`2 [System.String,mscorlib程序, 版本= 4.0.0.0,文化=中立, 公钥= b77a5c561934e089],[MIDAS.CheckedComboBoxItem,MIDAS, 版本= 1.0.0.0,文化=中性公钥=空],mscorlib程序, 版本= 4.0.0.0,文化=中性公钥= b77a5c561934e089 这是用来在.resx文件。确保必要的参考资料 已被添加到您的项目。行135,位置 5. C:\ Users \用户desig.nizam \文档\ Visual Studio 2010的\项目\ MIDAS \ MIDAS \ FGEO \ FGEO.resx 135 5 MIDAS
Error 1 Invalid Resx file. Could not load type System.Collections.Generic.Dictionary`2[[System.String, mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089],[MIDAS.CheckedComboBoxItem, MIDAS, Version=1.0.0.0, Culture=neutral, PublicKeyToken=null]], mscorlib, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089 which is used in the .RESX file. Ensure that the necessary references have been added to your project. Line 135, position 5. C:\Users\desig.nizam\documents\visual studio 2010\Projects\MIDAS\MIDAS\FGEO\FGEO.resx 135 5 MIDAS
我使用这种控制在一些形式中成功,但不是在新的。如果我删除了我没有错误可以编译表单控件。
I am using this control in some forms successfully, but not in the new ones. If I delete the controls of the forms I can compile without error.
我GOOGLE了解决方案,并能找到很多相关的话题,但没有人帮我解决我的情况。
I googled a solution and could find a lot of related topic, but none of them helped me to solve my case.
推荐答案
解决这个问题的方法是将此属性设置为词典:
The solution to this problem is to set this attribute to Dictionary:
<DesignerSerializationVisibility(DesignerSerializationVisibility.Hidden)>
,同样的问题在已经讨论
The same problem was already discussed in
这篇关于无效的Resx而在用户控件使用集合的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!