Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Unhandled exception in mono while running NancyFx

I'm running Ubuntu 12.04 and I have the mono-runtime package installed. On my windows machine my NancyFx self hosted application compiles fine with 1 warning but when I try to run it on my VPS I get the following error:

Unhandled Exception: System.IO.FileNotFoundException: Could not load file or
assembly 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one
of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'
[ERROR] FATAL UNHANDLED EXCEPTION: System.IO.FileNotFoundException: Could not load
file or assembly 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089' or one of its dependencies.
File name: 'System.Core, Version=4.0.0.0, Culture=neutral,
PublicKeyToken=b77a5c561934e089'

Any ideas on how I can fix this?

like image 334
Cris McLaughlin Avatar asked Jul 17 '14 22:07

Cris McLaughlin


1 Answers

I ran across the same problem when trying to run a Mono app (compiled in Xamarin Studio on my Windows machine) on an Ubuntu 14.04 Docker virtual. I did the same thing as you and installed mono-runtime, and after an hour or two of searching, was able to get it to work after installing mono-complete. However, that also brings down a few hundred MB of additional stuff. Finally I found the package that did the trick: libmono-system-core4.0-cil (see here).

Hope that helps!

like image 170
Mark Carpenter Avatar answered Oct 19 '22 13:10

Mark Carpenter