简体   繁体   中英

Porting a winform app to monodevelop on mac

I'm tryng to port a winforms app created in Visual Studio to Mac with monodevelop. After resolving compiling errors, when I run the program, the application outputs these exceptions:

System.NullReferenceException: Object reference not set to an instance of an object
 at System.Windows.Forms.TextBoxBase.set_Lines (System.String[] value) [0x00000] in <filename unknown>:0

  at (wrapper remoting-invoke-with-check) System.Windows.Forms.TextBoxBase:set_Lines (string[])

  at WindowsFormsApplication1.Main_Form.amp_portante_ValueChanged (System.Object Sender) [0x00025] in /Users/giuseppe/Desktop/CRUZER/Csound Converter/WindowsFormsApplication1/Main_Form.cs:381

  at KnobControl.KnobControl.OnValueChanged (System.Object sender) [0x00000] in <filename unknown>:0

  at KnobControl.KnobControl.set_Value (Int32 value) [0x00000] in <filename unknown>:0 
  at (wrapper remoting-invoke-with-check) KnobControl.KnobControl:set_Value (int)
  at WindowsFormsApplication1.Main_Form.textb2_TextChanged (System.Object sender, System.EventArgs e) [0x00085] in /Users/giuseppe/Desktop/CRUZER/Csound Converter/WindowsFormsApplication1/Main_Form.cs:1023 
  at System.Windows.Forms.Control.OnTextChanged (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.TextBoxBase.OnTextChanged (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.TextBoxBase.set_Text (System.String value) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.TextBox.set_Text (System.String value) [0x00000] in <filename unknown>:0 
  at WindowsFormsApplication1.Main_Form.SimpleFM_Conf () [0x00058] in /Users/giuseppe/Desktop/CRUZER/Csound Converter/WindowsFormsApplication1/Main_Form.cs:45 
  at WindowsFormsApplication1.Main_Form.Main_Form_Load (System.Object sender, System.EventArgs e) [0x00012] in /Users/giuseppe/Desktop/CRUZER/Csound Converter/WindowsFormsApplication1/Main_Form.cs:359 
  at System.Windows.Forms.Form.OnLoad (System.EventArgs e) [0x00000] in <filename unknown>:0 
  at System.Windows.Forms.Form.OnLoadInternal (System.EventArgs e) [0x00000] in <filename unknown>:0

The application works perfectly in Visual Studio and I have no idea what I should do.

You probably have a custom control (KnobControl) which you can't instantiate.

Maybe you don't have this control or this control doesn't compile with mono.

Take a look at line 381 in Main_Form.cs

Regards,

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM