Running a Winforms App

April 18, 2024, 06:03

geekypickles

Hey everyone, I'm currently working on a project that requires porting a winforms app to a Raspberry Pi 3 A+. I've tried mono, wine, and even Windows IOT so far to no avail. Is this actually possible to do or should I just rewrite my program? Thanks in advance.

oops.se

You say porting and then you describe different emulation of code execution environment on different OS. And my definition of porting is: Activity to make a code that runs on one OS usable on other OS.

geekypickles

My bad, I guess what I have been doing is trying to get emulation to work then. Any ideas how I could get that to work?

geekypickles

~~This is an exception I get when trying to run my program with mono, but not sure how useful this info is.~~ NVM this is something that only happened to me when trying to run through ssh. I am still struggling to run my app with mono through Raspbian though.

oops.se

Plz post text as text, that picture is unreadable

geekypickles

Whoops, I realized that particular issue was kind of irrelevant. I'm still at a loss for how to get my winforms app working on raspbian though. Here's what the text was: Unhandled Exception: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.ArgumentNullException: Could not open display (X-Server required. Check your DISPLAY environment variable) Parameter name: Display at System.Windows.Forms.XplatUIX11.SetDisplay (System.IntPtr display_handle) [0x00435] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at System.Windows.Forms.XplatUIX11.GetInstance () [0x0001c] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at System.Windows.Forms.XplatUI..cctor () [0x000e3] in <a3daa9b84fd241a497578a25f68bc3c7>:0 --- End of inner exception stack trace --- at System.Windows.Forms.Application.EnableVisualStyles () [0x00006] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at UHFReader18demomain.Program.Main () [0x00001] in <a3dc019ef35a4cbcbd9a996b8b0ac252>:0 [ERROR] FATAL UNHANDLED EXCEPTION: System.TypeInitializationException: The type initializer for 'System.Windows.Forms.XplatUI' threw an exception. ---> System.ArgumentNullException: Could not open display (X-Server required. Check your DISPLAY environment variable) Parameter name: Display at System.Windows.Forms.XplatUIX11.SetDisplay (System.IntPtr display_handle) [0x00435] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at System.Windows.Forms.XplatUIX11.GetInstance () [0x0001c] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at System.Windows.Forms.XplatUI..cctor () [0x000e3] in <a3daa9b84fd241a497578a25f68bc3c7>:0 --- End of inner exception stack trace --- at System.Windows.Forms.Application.EnableVisualStyles () [0x00006] in <a3daa9b84fd241a497578a25f68bc3c7>:0 at UHFReader18demomain.Program.Main () [0x00001] in <a3dc019ef35a4cbcbd9a996b8b0ac252>:0

oops.se

You are aware of that Raspberry Pi OS has switch from X11 to Wayland?

geekypickles

Sorry what does that mean