【发布时间】:2013-02-09 07:04:16
【问题描述】:
我用 C# 开发了一个完全在 Windows 中运行的完整应用程序。我现在已经在 Linux 上安装了 mono(RPi 上的 Debian),并且正在执行该应用程序。
第一个表单(登录表单)加载得很好。在此表单上输入了用户详细信息,如果详细信息正确,则应关闭该表单并打开下一个。
以下代码来自登录表单,一旦我按下“登录”就会执行:
this.Hide();
Entry_System fm = new Entry_System();
fm.ShowDialog();
this.Show();
但是,在 Linux 中,表单刚刚关闭,并出现以下错误:
System.TypeLoadException:发生类型加载异常。 在 System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] 中:0 在 System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] 中:0 在 System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs 事件) [0x00000] in :0 在 System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs 事件) [0x00000] in :0 在 System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] 中:0 在 System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] 中:0 在 System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 在 System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] 中:0 在 System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] 在:0 在 System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] 在 :0 在 System.Windows.Forms.NativeWindow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in :0
在 Windows 中,下一个表单会按预期打开。通过复选框选择的任一表单都是这种情况。
我已经运行了 apt-get update,apt-get mono complete,所以它们是最新版本。该应用程序是在 Windows 上编译的。我知道 mono 一直是一个很好的讨论主题,它在 Pi 上存在一些问题,但据我了解,像这样的基本功能在 Soft Float Debian 上应该可以正常工作。
【问题讨论】:
-
可能是框架版本不匹配。
标签: c# linux winforms mono raspberry-pi