Unable to run .net app with Mono - mscorlib.dll no

2019-01-22 00:34发布

I have a simple .net command line tool written and compiled under Windows, using .net 3.5SP1. I would like to run it on Linux using Mono.

I am using Ubuntu 12.04, and installed Mono Runtime using the Ubuntu software center. If I try to start my app in the terminal by doing:

mono MyApp.exe

I get the error:

The assembly mscorlib.dll was not found or could not be loaded. It should have been installed in the 'usr/lib/mono/2.0/mscorlib.dll'.

If I navigate to that location, I see that it does not exist. However, there is usr/lib/mono/4.0/mscorlib.dll (and some more DLLs in the same folder).

So seemingly there is a version mismatch.

[in case it matters, mono -V shows Mono JIT compiler version 2.10.8.1 (Debia 2.10.8.1-1ubuntu2) ]

标签: ubuntu mono
5条回答
来,给爷笑一个
2楼-- · 2019-01-22 01:18

i got the same problem, for my distro (ubuntu 12. 32 Bit ), mono-complete has not been available. so i just installed the following packages, and mono with the most important dlls has been available:

sudo apt-get install mono-dmcs
sudo apt-get install mono-gmcs
sudo apt-get install mono-devel
查看更多
走好不送
3楼-- · 2019-01-22 01:18

the package you're looking for was "libmono-system.data2.0-cil" which is installed with Mono-complete

查看更多
我想做一个坏孩纸
4楼-- · 2019-01-22 01:20

I got it to work by installing mono-complete:

sudo apt-get install mono-complete

After that, I had folders 2.0, 3.5, 4.0 and more under usr/lib/mono

查看更多
唯我独甜
5楼-- · 2019-01-22 01:28

If you just want to run it, sudo apt-get install libmono2.0-cil libmono-system-net2.0-cil mono-runtime may suffice.

查看更多
放我归山
6楼-- · 2019-01-22 01:31

I ran sudo apt-get purge mono-* and then sudo apt-get install mono-complete. This created the files in /usr/lib/mono, however the error was still generated where it was looking for the file in /usr/local/lib/mono which didn't exist.

Tried to change MONO_PATH to the correct location, but didn't work. Finally ended up copying the whole directory to /usr/local/lib which finally got it to work.

查看更多
登录 后发表回答