简体   繁体   中英

Windows Forms error in Linux environment on Raspberry Pi

I have developed a full application in C# that works entirely in Windows. I have now installed mono on Linux (Debian on RPi), and am executing the application.

The first form (a login form) loads perfectly fine. User details are entered, on this form and if the details are correct, it should close that form and open the next one.

The following code is from the login form, and is executing once I press "Login":

this.Hide();
Entry_System fm = new Entry_System();
fm.ShowDialog();
this.Show();

However, in Linux the form just closes and the following error occurs:

System.TypeLoadException: A type load exception has occurred. at System.Windows.Forms.Control.OnClick (System.EventArgs e) [0x00000] in :0 at System.Windows.Forms.Button.OnClick (System.EventArgs e) [0x00000] in :0 at System.Windows.Forms.ButtonBase.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in :0 at System.Windows.Forms.Button.OnMouseUp (System.Windows.Forms.MouseEventArgs mevent) [0x00000] in :0 at System.Windows.Forms.Control.WmLButtonUp (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Control.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.ButtonBase.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Button.WndProc (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Control+ControlWindowTarget.OnMessage (System.Windows.Forms.Message& m) [0x00000] in :0 at System.Windows.Forms.Control+ControlNativeWindow.WndProc (System.Windows.Forms.Message& m) [0x00000] in < filename unknown>:0 at System.Windows.Forms.NativeWi ndow.WndProc (IntPtr hWnd, Msg msg, IntPtr wParam, IntPtr lParam) [0x00000] in :0

In windows, the next form opens as expected. This is the case for either form that is selected through the checkbox.

I have run apt-get update, apt-get mono complete, so they are the latest versions. The application is compiled on Windows. I am aware that mono has been a well discussed subject, and there are some issues with it on the Pi, but as I understand it, basic functionality such as this should work fine on Soft Float Debian.

You may be hitting this bug , which is fixed in Mono 3.0.3.

I don't think apt-get makes sure you get such a new version though. You can confirm just by running the command "mono --version".

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