Debian: Unable to use mono (missing mscorlib.dll)

4

1

I've been trying over the months to use mono on Debian 7 x64 but try after try it never works. I've installed it on several different machines only to come to the same end:

mono program.exe
The assembly mscorlib.dll was not found or could not be loaded.
It should have been installed in the `/usr/local/lib/mono/4.5/mscorlib.dll' directory.

I've tried to install it on every way possible. In fact the only time I could see mono working was on a Ubuntu host but changing distro is not a option now. I dont believe this is a issue with my program because it worked on ubuntu.

This is how I proceed to install it (worked on Ubuntu, on debian never)

sudo apt-get update
sudo apt-get install libpng3 libpng3-dev libtool libtiff4 libtiff4-dev libexif12 libexif-dev libgif4 libgif-dev libpango1.0-dev libatk1.0-dev bison automake autoconf make gcc gtk-sharp2 build-essential xorg-dev libfreetype6 libfontconfig libfontconfig-dev gettext libglib2.0-dev git mono-complete libjpeg-dev
git clone git://github.com/mono/mono.git
cd mono
./autogen.sh --prefix=/usr/local
make
sudo make install

mono -V

Mono JIT compiler version 3.4.1 (master/683527c Sun Apr 20 04:18:47 CEST 2014)
Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
        TLS:           __thread
        SIGSEGV:       altstack
        Notifications: epoll
        Architecture:  amd64
        Disabled:      none
        Misc:          softdebug
        LLVM:          supported, not enabled.
        GC:            sgen

I've searched this problem extensively and no proposed solution worked. I wonder how can anyone get mono to work on debian ?

Thanks.

Sharp

Posted 2014-04-20T03:00:34.733

Reputation: 95

Small dump question: Are you sure the application you try to run is a CLI application? – ju.kreber – 2014-04-20T10:19:58.517

Yes it is. I was able to run it on Ubuntu, and several other people seem to run it just fine. Its just this "thing" with debian that makes no sense. – Sharp – 2014-04-20T14:39:37.113

Okay. Have you checked the "missing" dll? is it there and can't be loaded for some reason or is it really missing? In this case I would try to download it manually. – ju.kreber – 2014-04-20T15:38:07.190

/usr/local/lib/mono does not exist. It makes me think it is probably somewhere else and pointing to the wrong path. And I'm not sure where I should download it from – Sharp – 2014-04-20T17:39:29.137

Mhm this is possible of course. Can't you find any mono-lib folders? For me it's under /usr/lib/. What about checking the scripts? What does this autogen.sh do? I suppose it's setting up a makefile your you.. What is then written in this makefile? Are the folders there correct? Compare the paths there and look if files have been copied correctly. – ju.kreber – 2014-04-20T20:33:00.520

It found mine under /usr/lib/ as well but no 4.5 subdir, only for 2.0, 3.5 and 4.0. I copied /usr/lib/ to /usr/local/lib/mono. After trying to run I now get a "Native stacktrace (...) Got a SIGSEGV while executing native code (...)". I suspected that the curlpit is "--prefix=/usr/local". I reinstalled using "--prefix=/usr". Same result. – Sharp – 2014-04-20T23:17:31.397

Okay. Funny thing is i got the same error yesterday. Just a question: Is the program you try to run a .NET windows application? It was the case for me. My missing mscorlib.dll should be in the 2.0 folder, i only had a 4.0 one. symlinked this one to 2.0 (just to try :D) - bunch of errors. I had to run the application through wine, with the dotnet extension. Maybe this could be the issue for you too? – ju.kreber – 2014-04-21T17:30:56.813

Answers

2

The libmono-corlib4.5-cil package contains /usr/lib/mono/4.5/mscorlib.dll.

I think you should be able to just install everything from packages; there should be no need to compile mono from source and install it manually under /usr/local:

sudo apt-get install mono-complete libmono-corlib4.5-cil

And be sure you remove your manually installed mono from /usr/local.

András Korn

Posted 2014-04-20T03:00:34.733

Reputation: 266

Not useful if you're on a platform where you cannot use source packages. Debian PowerPC has broken mono packages right now. – Wyatt8740 – 2018-06-19T02:36:09.850