This tutorial will show you how to install Mono and Monodevelop in order to develop .NET 3.5 projects. This is useful when writing C# assembly mods for Unity engine based games, such as RimWorld, as they tend to require .NET 3.5.
If you don’t use .NET 3.5, you may get errors including but not limited to:
System.TypeLoadException: Could not load type 'System.Action' from assembly 'ModName'.
That error is commonly thrown when versions such as .NET or .DLLs mismatch.
Mono 4.0 and later don’t support .NET 3.5. Therefore, we’ll need to install an older version.
I couldn’t find many posts about this, doesn’t seem that many people develop RimWorld on Linux.
After this tutorial, MonoDevelop will support the following target frameworks: Mono / .NET 2.0, Mono / .NET 3.0, .NET 3.5 Client Profile, Mono / .NET 3.5, .NET 4.0 Client Profile, Mono / .NET 4.0, Mono / .NET 4.5, .NET Framework 4.5.1
Uninstall any installed Mono versions
Unfortunately I do not know of a way to keep multiple versions of Mono and Monodevelop installed at a time, so you’ll need to uninstall them:
Now check that mono is not installed:
Add PPA for Mono 3.12.x
We need to add a snapshot PPA, as described in the mono-project docs.
Install Mono and Monodevelop
Now we need to install Mono 3.14 and Monodevelop 5.7. We also need to lock the versions of the installed packages, to stop apt-get upgrade from installing Mono 4.0+ and reversing our efforts. We use apt-mark hold to do this.
For more information, see this thread about installing from a specific repository and this thread about locking package versions.
Should give something like:
Mono JIT compiler version 3.12.1 (tarball Fri Mar 6 19:12:47 UTC 2015) Copyright (C) 2002-2014 Novell, Inc, Xamarin Inc and Contributors. www.mono-project.com
And monodevelop should be in the start menu. Note that you may need to restart your computer, depending on your window manager.
Next: Setting up a MonoDevelop solution and project for RimWorld modding.
Here is an error you may get when implementing a JobDriver using .NET 4.0+
Exception in SetupToil(pawn=Kimmy, job=Accident): System.TypeLoadException: Could not load type 'System.Action' from assembly 'toilets'. at Verse.AI.JobDriver.SetupToils() Verse.Log:Error(string) Verse.AI.JobDriver:SetupToil() Verse.AI.Pawn_JobTracker:StatJob(Job, JobCondition, ThinkNode, Boolean, Boolean, ThinkTreeDef) Verse.AI.Pawn_JobTracker:TryFindAndStartJob() Verse.AI.Pawn_JobTracter:EndCurrentJob(JobCondition)