I’m trying to port over a .NET application that was written in C#, into linux.
The compatibility test using the MoMa tool says the application is compatible.
I compiled the code using Visual Studio 2010, and copied the resulting .exe file over to my Ubuntu VM (running 10.04 LTS).
I had installed mono with the badgerport sources (from http://badgerports.org/lucid.html). I see that I have the 4.0 libraries in the /usr/lib/mono directory:
user@ubuntu:~$ ls -l /usr/lib/mono
total 52
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 2.0
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 3.5
drwxr-xr-x 3 root root 12288 2012-08-27 07:15 4.0
drwxr-xr-x 2 root root 4096 2012-08-27 07:14 compat-2.0
drwxr-xr-x 145 root root 12288 2012-08-27 07:15 gac
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 mono-configuration-crypto
drwxr-xr-x 2 root root 4096 2012-08-27 07:15 monodoc
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 xbuild
drwxr-xr-x 3 root root 4096 2012-08-27 07:15 xbuild-frameworks
When I look at the man page for mono, I see at hte top Mono 2.5.
And mono -V returns the following.
user@ubuntu:~$ mono -V
Mono JIT compiler version 2.10.8.1 (Debian 2.10.8.1-1~dhx1~lucid1)
Copyright (C) 2002-2011 Novell, Inc, Xamarin, Inc and Contributors. www.mono-project.com
TLS: __thread
SIGSEGV: altstack
Notifications: epoll
Architecture: x86
Disabled: none
Misc: softdebug
LLVM: supported, not enabled.
GC: Included Boehm (with typed GC and Parallel Mark)
Here is the output when I try to run the application.
user@ubuntu:~$ mono MyApplication.exe
Unhandled Exception: System.TypeLoadException: A type load exception has occurred.
at MyApplication.ConsoleRunner..ctor () [0x00000] in <filename unknown>:0
at MyApplication.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
[ERROR] FATAL UNHANDLED EXCEPTION: System.TypeLoadException: A type load exception has occurred.
at MyApplication.ConsoleRunner..ctor () [0x00000] in <filename unknown>:0
at MyApplication.Program.Main (System.String[] args) [0x00000] in <filename unknown>:0
Any insights into what is going on, and what I can do to fix it? Unfortunately I am confined to using Ubuntu 10.04 due to other development constraints.
You definitely not have to compile using Mono compiler, at least not by design. Try running with
MONO_LOG_LEVEL="debug" mono your_software.exe, you will see attempts to find assembly and other, possibly useful, informations. And put it here 😉