Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Windows Forms Designer - automatically adds namespace in front of class

I have problem with Visual Studio Designer.

When I display design of a form, designer automatically adds namespace in front of class, which is used as datasource. But this class is in the same namespace as the form.

It is annoying.

Example:

namespace Editor
{
    partial class AddSignalForm
    {
      ...
      this.signalsBS.DataSource = typeof(Signal);

    }
}

Signal is in namespace Editor.

But after I open designer, code is changed to:

namespace Editor
{
    partial class AddSignalForm
    {
      ...
      this.signalsBS.DataSource = typeof(Editor.Signal);

    }
}

Problem is that compiler can not find class Editor.Editor.Signal.

like image 584
Michal Avatar asked Feb 24 '23 02:02

Michal


1 Answers

You seem to have another class or property named Editor which conflicts with the namespace.

like image 181
Julien Lebosquain Avatar answered Feb 26 '23 03:02

Julien Lebosquain