Dear support,
Hello, I am currently trying to migrate my old application that is running on BSP 2.8b7. In order to test the procedure, I have developed a simple HelloWorld application.
However, when I attempt to run it using mono, I am encountering the following issues:
root@colibri-imx6-11101965:~/test# mono test.exe
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) [0x003d0] in <93691e59f439433484aaf50c07423456>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in <93691e59f439433484aaf50c07423456>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00019] in <93691e59f439433484aaf50c07423456>:0
at System.Windows.Forms.XplatUI..cctor () [0x000c0] in <93691e59f439433484aaf50c07423456>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Application.EnableVisualStyles () [0x00006] in <93691e59f439433484aaf50c07423456>:0
at test.Program.Main () [0x00001] in <d081c7dc415b47e4903a14d4ea56db9d>: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) [0x003d0] in <93691e59f439433484aaf50c07423456>:0
at System.Windows.Forms.XplatUIX11..ctor () [0x00077] in <93691e59f439433484aaf50c07423456>:0
at System.Windows.Forms.XplatUIX11.GetInstance () [0x00019] in <93691e59f439433484aaf50c07423456>:0
at System.Windows.Forms.XplatUI..cctor () [0x000c0] in <93691e59f439433484aaf50c07423456>:0
--- End of inner exception stack trace ---
at System.Windows.Forms.Application.EnableVisualStyles () [0x00006] in <93691e59f439433484aaf50c07423456>:0
at test.Program.Main () [0x00001] in <d081c7dc415b47e4903a14d4ea56db9d>:0
root@colibri-imx6-11101965:~/test#
i have added mono to my BSP using Yocto and it seems to be fine :
root@colibri-imx6-11101965:~/test# mono --version
Mono JIT compiler version 6.12.0.182 (tarball Sun 24 Dec 2023 10:28:00 AM UTC)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: normal
Notifications: epoll
Architecture: armel,vfp+hard
Disabled: none
Misc: softdebug
Interpreter: yes
LLVM: supported, not enabled.
Suspend: preemptive
GC: sgen (concurrent by default)
root@colibri-imx6-11101965:~/test#
Could you please assist me in figuring out the issue?
i am using : colibri IMX6 based on 6.4BSP with Colibri-iMX6_Reference-Multimedia-Image-upstream-Tezi_6.5.0-devel-20231224113403+build.0.tar Yocto tag and iris career board