[Fix] If you are running Debian 7 (Wheezy) and Mono 4.8.1 you may encounter this problem with a missing DLL file

I was trying to setup a FiveM server and ran into several issues. I received help from Blizzn on the Discord server and he came up with a fix for a pretty niche problem that isn’t mentioned here.

When trying to run FiveM / Mono on Wheezy installation of Debian you will encounter an issue wherein it throws an error as follows:

System.TypeInitializationException: The type initializer for 'Microsoft.AspNetCore.Server.Kestrel.Internal.Infrastructure.Constants' threw an exception. ---> System.DllNotFoundException: System.Native.....

The issue stems from the fact that Wheezy, by default, uses the outdated version of libc6 2.13, wherein you are required at the minimum, for Mono 4.8.1, to use libc6 2.14.

This was revealed when he was troubleshooting his clone of my server setup, and he found this in the logs for Mono. (in the event you were curious)

Mono: DllImport error loading library '/root/cfx-server/mono/libSystem.Native.so': '/lib/x86_64-linux-gnu/libc.so.6: version `GLIBC_2.14' not found (required by /root/cfx-server/mono/libSystem.Native.so)'

The solution was to simply force-update the software by ammending the following lines to the sources list located at:

  • /etc/apt/sources.list
deb http://httpredir.debian.org/debian  sid main contrib non-free
deb-src http://httpredir.debian.org/debian sid main contrib non-free

Following, all you would need to do is run:

apt-get update
apt-get install -t sid libc6 libc6-dev

At this point everything should run smoothly. You can try out your server by navigating to its install directory and typing:

./run.sh

Hopefully this fix helps someone else out, who like me is/was struggling for an answer. This is part of a 10+ hour problem I had with actually getting a server up and running! Yeah, I’m that much of a noob ;).

P.s. Once again, massive thanks to Blizzn on the Discord server for helping me out with this stuff! Special mention to @Beef as well and others names I forget to mention :slight_smile:

2 Likes