Open WinForm Error Constructor

I am working on VS 2010.NET 4.0, my application has winForm with many controls. I once met a very constructive error of the designer:

Could not find type 'Namespace.TypeName'. Make sure that the assembly containing this type is referenced. If this type is part of your development project, make sure that the project has been successfully created. The variable "ControlName" is either not declared or has never been assigned.

i click Ignore and Continue, the control will disappear from my form. if I look in designer.cs, controls exist.

I read this: link text , but it is in vs2003, and I cannot solve this problem.

Thank..

+3
source share
1 answer

This problem can be caused in several ways, usually through custom controls / components, which:

  • You do not have a default constructor
  • Depends on variables that are set at runtime (singleton instances, data sources, etc.)
  • Unable to compile (you cannot use the control in the constructor until compilation is successful)
  • Have been significantly modified / rewritten as they were added to the form

This can also happen as a result of a crash in Visual Studio - this is much less common, but can usually be fixed by cleaning and restoring your solution and / or restarting the IDE.

+8

Source: https://habr.com/ru/post/1773143/


All Articles