TeamCity NUnitLauncher running on Linux (mono) gives the error "Corlib does not sync with this version"

Running TeamCity build agent to run NUnit tests on Ubuntu 14.04 LTC with the latest mono version seems to have some dependency problems that I cannot solve for me. I performed the following installation steps

When the TC build agent starts the NUnit step, it just fails, and looking at the logs shows that it is executing

/usr/bin/mono-sgen /home/ubuntu/buildAgent/plugins/dotnetPlugin/bin/JetBrains.BuildServer.NUnitLauncher.exe 

which quickly returns with

 Corlib not in sync with this runtime: expected corlib version 117, found 111. Loaded from: /usr/lib/mono/4.0/mscorlib.dll Download a newer corlib or a newer runtime at http://www.mono-project.com/download. 

Is there any possible way to make this work? I tried to remove all parts and reinstall and even install an older version of monostructure, but to no avail.

The TC connection appears, and I can manually call and call mono myself and even nunit-console, but this .exe assembly provided by TC seems to be deadlocked as linux is not an expert.

Please save me from the hell of Adventism !!

Change I decided to just solve my problem by installing nunit-console and turning on the XML report nunit-console function, rather than playing with corelib files and breaking something else.

+6
source share
4 answers

This is a Mono error, see https://bugzilla.xamarin.com/show_bug.cgi?id=34675 .

The problem is that Mono switched to providing builds 4.0, including mscorlib.dll, only as reference builds. They contain only metadata and are intended for the compiler. Typically, applications use the latest version automatically.

The bootloader code in Mono, however, has not been updated to snap forward an explicit version of the v4.0.20506 or v4.0.30128 runtime that TeamCity uses in its latest .exe.config files. Instead, the runtime tries to download mscorlib.dll from the 4.0 directory and is released on bail because the version is too old (it has been since the creation of the referenced assemblies).

As a workaround, you can edit the <build agent installdir>/plugins/dotnetPlugin/bin/JetBrains.BuildServer.NUnitLauncher.exe.config (and other .exe.config files) and delete the following lines:

 <supportedRuntime version="v4.0.20506"/> <supportedRuntime version="v4.0.30128"/> 

This may stop if TeamCity decides to update the plugin.

+3
source

Replacing the mscorlib version only causes problems - for example, TypeLoadException and friends are waiting for you around the corner to get you.

I made the replacement of the Teamcity build step by manually calling TC NunitLauncher, but forcing it to use Mono 4.5:

 mono --runtime=4.5 /Applications/buildAgent/plugins/dotnetPlugin/bin/JetBrains.BuildServer.NUnitLauncher.exe v4.0 MSIL NUnit-2.6.3 $(find **/bin/Release/*Tests.dll | paste -sd ";" -) 

The call uses some shell wrapper to find all the assemblies that interest me with a wildcard, but this should not be understood.

It would be nice if Mono fixed its broken version 4.0. Has someone already reported this https://bugzilla.xamarin.com/ ?

+2
source

Here's how I worked on this: (note that my mono is in / opt / mono)

 $ cd /opt/mono/lib/mono $ sudo mv 4.0 __4.0 $ sudo ln -s 4.5 4.0 

I will get rid of folder 4.0 and symbolic link 4.5 4.0

It's a bit of a hack, but it made me work and work until the right surfaces were found!

Steve

0
source

I had this problem on my raspberry Pi after compiling 4.0.2, but it was loading from /4.5/

It made me go:

 sudo mv /usr/lib/mono/4.5/mscorlib.dll /usr/lib/mono/4.5/_old_mscorlib.dll sudo cp /opt/mono-4.0.2/lib/mono/4.5/mscorlib.dll /usr/lib/mono/4.5 
0
source

Source: https://habr.com/ru/post/986368/


All Articles