Problem referencing ControlDesigner class

  • Thread starter Thread starter Craig Watson
  • Start date Start date
C

Craig Watson

I am having a problem with a C# project (a controls library). I need to set
up a designer for a few of the custom attributes and have created a class as
follows:

public class MyDesigner : System.Windows.Forms.Design.ControlDesigner

At the top of the file, I have included the appropriate namespace:

using System.Windows.Forms.Design;

I get the following compilation error:

The type or namespace name 'ControlDesigner' does not exist in the class
or namespace 'System.Windows.Forms.Design' (are you missing an assembly
reference?)

If I start typing a variable declaration, I get the "type-ahead" as
expected. I have System.Windows.Forms.Design, but within that namespace, I
see only the following types:

ComponentEditorForm
ComponentEditorPage
EventsTab
PropertyTab
WindowsFormsComponentEditor

I have tracked down this issue on-line using other resources, but the
"solution" is always to make sure that the "using" statement is typed
correctly. I am not a newbie and I am sure that I have typed it correctly.

Is it possible that the DLL could have been replaced/overwritten by some
other program install? Maybe my IT department installed a goofy version of
Visual Studio? Has anyone run across this before? I don't have any unusual
software installed, so I don't think the problem is another installation.

By the way, I am running .NET framework version 1.1.4322.

Thanks in advance.
 
After messing around with this for quite a while, I figured out the problem.
The class System.Windows.Forms.Design.ControlDesigner is not in the
System.Windows.Forms.dll as I expected. It is in the System.Design.dll which
is not included in C# projects by default.

Go figure.
 
Back
Top