WinForm designer error open designer

我们两清 提交于 2019-12-10 10:27:34

问题


I work on VS 2010 .net 4.0 , my app had winForm with many controls. sometime i occur very starnge designer error:

Could not find type 'Namespace.TypeName'. Please make sure that the assembly that contains this type is referenced. If this type is a part of your development project, make sure that the project has been successfully built. The variable 'ControlName' is either undeclared or was never assigned.

i click Ignore and Continue the control disappear from my form. if i look in designer.cs the controls are exists..

I read this : link text but it is in vs2003 and i can not sucess solve this problem..

Thanks..


回答1:


This problem can be caused in a number of ways, usually by custom controls/components that:

  • Do not have a default constructor
  • Depend on variables that are set at run-time (singleton instances, data sources, etc)
  • Fail to compile (you can't use a control in the designer until it compiles successfully)
  • Have been significantly changed/rewritten since they were added to the form

It can also happen as a result of a glitch in Visual Studio - this is much rarer, but can usually be fixed by cleaning and rebuilding your solution and/or restarting the IDE.



来源:https://stackoverflow.com/questions/4101715/winform-designer-error-open-designer

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!