MonoGame with MGCB-Editor on a Rolling-Release Linux Distros

If you get the following Error when you are trying to use the MGCB-Editor:

"System.NullReferenceException: Object reference not set to an instance of an object. at Gtk.Widget.DrawnSignalCallback(IntPtr inst, IntPtr arg0, IntPtr gch)"

or Intellisense is not working in your Monogame Project, then this Blog-Entry is for you! There is (at the moment) a issues with Monogame and Rolling-Release Linux Distros like Arch Linux. Its glib2. That makes the use of the MGCB-Editor impossible on Linux without the downgrading and breaking of a lot of things. But there is a fix. Not a super clean one but it works.

Swap #USERNAME# with your Linux Username!

I don't show how to create a project in this Blog-Entry. This is only about the "mgcb-editor" issue.

If Monogame finally gets an update an fixes that Bug you don't need to do that wine part anymore.

You also could try to compile the the GitHub-version of Monogame. But I could not because of glib2.


  1. First you need to fulfill some dependencies. Install the following packages (on other Disros find them, on Arch just execute the following):

    sudo pacman -S code dotnet-sdk mono mono-tools mono-msbuild mono-msbuild-sdkresolver mono-addins


  2. You need to install Visual Studio Code from the official Website or the AUR on Arch Linux. The OSS version will not work! For some reason the OSS version can not use the .NET-CORE stuff for C#. If your system complains that CSS-VS-Code and the MS-VS-CODE version interfere, uninstall the OSS-VS-CODE.

    MS-VS-CODE Version's:

    visualstudio.com or AUR


  3. Install the following VS-Code-Addons shown in the Addons-Image below (yes also the Unity one).


  4. Now download and install "dotNET-SDK 3.1" inside a wine-prefix:

    dotNET-SDK 3.1: dotnet.microsoft.com


  5. Navigate to the Monogame insall Location: "/home/#USERNAME#/.dotnet/tools/.store/dotnet-mgcb-editor/3.8.0.1641/dotnet-mgcb-editor/3.8.0.1641/tools/netcoreapp3.1/any/" and check of everything is there including "mgcb-editor-wpf.exe".


  6. Now start the "mgcb-editor-wpf.exe" inside your wine-prefix with:

    "export DOTNET_ROOT="C:\\Program Files\\dotnet" && wine /home/#USERNAME#/.dotnet/tools/.store/dotnet-mgcb-editor/3.8.0.1641/dotnet-mgcb-editor/3.8.0.1641/tools/netcoreapp3.1/any/mgcb-editor-wpf.exe"


    It is very slow and a little Buggy but it works. Add your "Content.mgcb" and start working. Assets you want to add MUST be in the same folder OR lower (subfolder). Anything else will break paths in the "Content.mgcb". This happens because of the way wine is routing path's.

    It's also very VERY important that DXVK or simular is NOT intstalled in the wine-prefix. It will break the WPF interface!

    You also MUST start the "mgcb-editor" always with this command. For some reason "DOTNET_ROOT"-Variable gets lost after a reboot after the first installation.

    That's it. Now you can use the Content-Manager and start working on your project.


VS-Code-Addons Image
VS-Code-Addons needed

Sources: