How can I open the MGCB Editor on macOS Sonoma?

Nothing happens when I double click or right click the Content.mgcb file in Visual Studio for Mac 17.6.6 (build 408).
In addition, I have tried to double click the Content.mgcb file in my project’s directory, but then it just says that the application MGCB Editor cannot be opened.
How can I open the MGCB editor on my iMac Intel Core i5?

Open a terminal in the project directory (the directory with the .csproj of your game) and enter the command

dotnet mgcb-editor ./Content/Content.mgcb

Report back any errors

2 Likes

I get this error:

Monogameiostest % The application /Users/name/.nuget/packages/dotnet-mgcb-editor-mac/3.8.1.303/tools/net6.0/any/MGCB Editor.app cannot be opened for an unexpected reason, error=Error Domain=RBSRequestErrorDomain Code=5 “Launch failed.” UserInfo={NSLocalizedFailureReason=Launch failed., NSUnderlyingError=0x60000392d6e0 {Error Domain=NSPOSIXErrorDomain Code=111 “Unknown error: 111” UserInfo={NSLocalizedDescription=Launchd job spawn failed}}}

And this is an intel mac? Not an M1 or M2?

Yes. 3,7 GHz 6-Core Intel Core i5.

Let me check something when I get home later and can use my macbook. I think this may be a execution permission thing (chmod) but want to verify on an actual mac

Ok sorry for the delay, open a terminal and enter the following command

ls -l ~/.nuget/packages/dotnet-mgcb-editor-mac/3.8.1.303/tools/net6.0/any/MGCB\ Editor.app/Contents/MacOS | grep  mgcb-editor-mac
  • ls is for listing all files in the directory, the -l flag tells it to list the files in a long format
  • | pipes the output of that command into the next command
  • grep mgcb-editor-mac filters the output to only show the lines with mgcb-editor-mac in them

You should see an output similar to the following

What you’re looking for is the x to appear in the flag list on the left side of the line where it shows just mgcb-editor-mac. By having thisi x flag appear there, it means it’s executable

It looks like this:

iMac Monogameiostest % ls -l ~/.nuget/packages/dotnet-mgcb-editor-mac/3.8.1.303/tools/net6.0/any/MGCB\ Editor.app/Contents/MacOS | grep mgcb-editor-mac
-rwxr–r-- 1 root staff 132240 Jul 26 2022 mgcb-editor-mac
-rwxr–r-- 1 root staff 76606 Jul 26 2022 mgcb-editor-mac.deps.json
-rwxr–r-- 1 root staff 359936 Jul 26 2022 mgcb-editor-mac.dll
-rwxr–r-- 1 root staff 182 Jul 26 2022 mgcb-editor-mac.dll.config
-rwxr–r-- 1 root staff 270 Jul 26 2022 mgcb-editor-mac.runtimeconfig.json
iMac Monogameiostest %

Hmm, its showing these are all owned by root.

How did you install the dotnet sdk?

I don’t remember how I installed the different dotnet sdk versions. Which SDK should be installed on my iMac so that I can use the MGCB Editor?

iMac ~ % dotnet --list-sdks
3.1.426 [/usr/local/share/dotnet/sdk]
6.0.414 [/usr/local/share/dotnet/sdk]
6.0.415 [/usr/local/share/dotnet/sdk]
6.0.416 [/usr/local/share/dotnet/sdk]
7.0.308 [/usr/local/share/dotnet/sdk]
7.0.401 [/usr/local/share/dotnet/sdk]
8.0.100-rc.2.23502.2 [/usr/local/share/dotnet/sdk]

Is macOS Sonoma supported or is it better to use an older macOS version with the MGCB Editor?