In a windows form I am populating a combo box with the following code.
this.JackStudTypeComboBox.Items.AddRange(ViewController.GetJackStudMaterialType().ToArray());
When I attempt to open the Form Designer I get the message that the ViewController type is not found.
The ViewController class is located in the same project as the form. Compiling the project has no issues, and running the project results in the expected behaviour.
So, how do I convince the Form Designer to locate this particular class, or to ignore the fact that it is unable to find it or do anything useful with it when in static design mode?
Don’t do that.
You should never put any custom logic in
InitializeComponent().Move that to the constructor and everything will work fine.