Table of Contents

Setting up your development environment for macOS and Linux

A step-by-step guide for setting up your development environment on macOS and Linux.

This section provides a step-by-step guide for setting up your development environment on macOS and Linux.

The only development environment that MonoGame officially supports on Linux is Visual Studio Code.

Install .NET 6 SDK

dotnet workload install ios
dotnet workload install android

macOS considerations

For the time being, MonoGame requires that you install the x64 version of the .NET SDK even if you are running on an Apple Silicon mac. It is also required that Rosetta is enabled.

[Optional] Install Visual Studio Code

You can install Visual Studio Code at: https://code.visualstudio.com/Download

In order to code and build C# projects, you will also need to install a Visual Studio Code C# extension. You can do this with the following commands:

code --install-extension ms-dotnettools.csharp

If you want, you can also install the C# Dev Kit extensions, which are not open source:

code --install-extension ms-dotnettools.csdevkit
code --install-extension ms-dotnettools.dotnet-maui

Install MonoGame templates

dotnet new --install MonoGame.Templates.CSharp

[Optional] Setup Wine for effect compilation

Effect (shader) compilation requires access to DirectX, so it will not work natively on Linux systems, but it can be used through Wine. Here are instructions to get this working (providing that your distribution is using apt).

Install wine64:

sudo apt install wine64 p7zip-full curl

Create wine prefix:

wget -qO- https://monogame.net/downloads/net6_mgfxc_wine_setup.sh | bash

If you ever need to undo the script, simply delete the .winemonogame folder in your home directory.

Next up: Creating a new project