MGCB Editor crashes when trying to launch

I have Monogame setup under Ubuntu 21.04 (Xorg) and everything is working fine besides mgcb-editor. I have it installed through the command line with the command dotnet tool install --global dotnet-mgcb-editor and it installs successfully and I registered it right after as well. Unfortunately whenever I try to launch it it just immediately crashes and gives me this error message:

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

I’ve looked around and saw that not having gtk-sharp3 installed would cause an issue like this so I installed that as well and I’m still getting the same error. I’ve reinstalled multiple times with still no luck. Any help would be appreciated.

This seems to be a common bug on Linux right now. It appears to be related to a new version of GTK that the GtkSharp that MonoGame is using doesn’t support yet.

Although it’s not released yet, there is a fix already. I’m not sure when a release is going to happen, but it works for me if I compile the content pipeline myself. To give you an idea of how it’s done, have a look at my AUR package here: AUR (en) - mgcb-editor-git

Of course AUR is for Arch Linux, but when you have a look at the PKGBUILD in there it’ll show you which commands are used to install it.

This is not a “real” fix though, just a temporary workaround until the tool is being updated. I hope it’ll help you to keep up the development with MonoGame!