Windows Forms Designer - automatically adds a namespace in front of a class

I have a problem with Visual Studio Designer.

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

This is annoying.

Example:

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

The signal is in the Editor namespace.

But after I open the constructor, the code changes to:

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

The problem is that the compiler cannot find the Editor.Editor.Signal class.

+4
source share
1 answer

You seem to have another class or property called Editor that conflicts with the namespace.

+7
source

All Articles