0

I am trying to run a simple Windows Forms application on a imx8m nano SOM board running Debian 11. I built the application on Windows using Visual Studio, SCP'd the .exe from the bin folder over to the board, but whenever I run it with mono {app-name}.exe it gives me this error: Cannot open assembly '{app-name}.exe': File does not contain a valid CIL image.

This is the output of mono -V:

Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       normal
        Notifications: epoll
        Architecture:  arm64
        Disabled:      none
        Misc:          softdebug
        Interpreter:   yes
        LLVM:          yes(610)
        Suspend:       preemptive
        GC:            sgen (concurrent by default)

I believe I have the .NET sdk/runtime installed corretcly as I can compile a simple example with csc {app-name}.cs and successfully run it with mono {app-name}.exe. I installed it with the instructions here: https://learn.microsoft.com/en-us/dotnet/core/install/linux-scripted-manual#scripted-install

I have also tried it with a simple console application and I get the same results.

{app-name} is a filler for the actual application's name.

I also noticed that Debian 11 isn't technically supported on this website: https://www.mono-project.com/download/stable/#download-lin-debian but they say it should work nonetheless.

What can I do to get this application to run on this board?

I was following this tutorial loosely if it helps: http://comfilewiki.co.kr/en/doku.php?id=comfilepi:running_.net_winforms_applications_with_mono:index

I believe the problem is most likely due to my Windows machine running the x86 architecture and the ixm8m board being ARM architecture. I don't have time to test cross-compiling out for a few days, but I will roughly follow the tutorial for the RPi linked above if that is the correct way to do it.

  • It is this kind of articles that build up false hope on porting WinForms applications to non-Windows platforms. Mono is giving place to .NET Core, and WinForms remains a Windows only UI framework. To build a Debian 11 compliant GUI app, you should choose a suitable UI framework, https://blog.lextudio.com/the-story-about-net-cross-platform-ui-frameworks-dd4a9433d0ea – Lex Li Feb 04 '22 at 19:33
  • Thanks for this info! There seems to be a lot of misleading information out there so this is very much appreciated! Thanks! – Duncan Van Keulen Feb 07 '22 at 16:35

0 Answers0