Guide: Setup Unity / Rider / Mono on Fedora 41 (Linux)

Alright,

it took me a couple days to get this running, so I figure that I might share it now for others, who want to escape ubuntu, like I have.

If you install mono-complete from fedoras repository, you’ll find that it doesn’t come with msbuild, which can become a major pain point if you don’t really care about the tooling behind your setup - until it doesn’t work. Like I did. So…

First, install mono

sudo rdf install mono-complete

Now you’ll run into the problem that mono does not actually come with msbuild, which you’ll need, if you want to use rider. You can download it separately here

https://github.com/mono/msbuild/releases/download/v16.9.0/mono_msbuild_6.12.0.137.zip

Unzip and copy the folder “msbuild” into

/usr/lib/mono

so now you sould have a directory named

/usr/lib/mono/msbuild

Then configure Rider under Settings => Build, Execution, Deployment => Toolset and Build

I’m not actually sure, if you need dotnet for this to work, but if you do, I recommend the installer script from microsoft, which you’ll get here

https://learn.microsoft.com/en-us/dotnet/core/tools/dotnet-install-script

and then you can just move into its download directory and use it. I installed dotnet 2.2 like this

dotnet-install.sh --channel 2.2

By default, the dotnet CLI executable should end up in your home directory under .dotnet/dotnet as you can see in my rider config above.

Now you should be good.
Have fun coding.

.
Edit: This Setup works, but can be improved further. For a more complete and flexible Mono development experience (and a more Debian conform setup), look 2 posts below and consider following 3 additional steps by @schilfbuerger .

Or you can just install dontet 9 sdk and everything would work

@wiredninja, thanks a lot for hinting on this, saving me the hours you spent.

Some improvement proposals:

  1. Place the content of the msbuild folder into /usr/lib/mono/msbuild/16.9/bin, like e.g. done on Debian where mono-develop places it into /usr/lib/mono/msbuild/15.0/bin.
  2. Create a shim in /usr/bin, like e.g. done by mono-develop on Debian:
sudo bash -c 'cat > /usr/bin/msbuild' << EOF
#!/bin/sh
MONO_GC_PARAMS="nursery-size=64m,$MONO_GC_PARAMS" exec /usr/bin/mono --assembly-loader=strict $MONO_OPTIONS /usr/lib/mono/msbuild/16.9/bin/MSBuild.dll "$@"
EOF
  1. sudo chmod +x /usr/bin/msbuild

For your own good, use Fedora’s own repository for installing dotnet, do NOT download it from Microsoft :slight_smile: