c# - 将 winform 应用程序移植到 mac 上的 monodevelop

标签 c# winforms visual-studio monodevelop

我正在尝试使用 monodevelop 将在 Visual Studio 中创建的 winforms 应用程序移植到 Mac。解决编译错误后,当我运行程序时,应用程序输出这些异常:

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

该应用程序在 Visual Studio 中运行完美,我不知道我应该做什么。

最佳答案

您可能有一个无法实例化的自定义控件 (KnobControl)。

也许你没有这个控件或者这个控件没有用 mono 编译。

看看 Main_Form.cs 中的第 381 行

问候,

关于c# - 将 winform 应用程序移植到 mac 上的 monodevelop,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/14912714/

相关文章:

c# - 为空时创建新 SqlConnection 的最佳方法

c# - 力扣 : Prison Cells After N Days

c# - 在 Winform C# 中单击按钮打开标签页

.net - 对于 Windows 窗体,PostMessage 与 self 的等价物是什么?

sql-server - SSDT、SSDT-BI 在不同 SQL 版本的向后兼容性方面的混淆

c# - 为什么 Visual Studio Debugger 不枚举 BitArray 并显示结果?

c# - Microsoft visual studio 2013 is busy 错误

c# - 为什么不调用此命令?

c# - 从下拉列表中设置枚举

c# - 如何使用处理消息队列执行 Monitor.Wait?