Hello all,
On a fresh installment I’m receiving a exit code the following command:
“dotnet” “mgcb” /quiet …… exit code -1
Things i’ve tried so far:
- install both .NET 9.0 x64 as well as x86
- install MonoGame.Templates.CSharp extension
- remove block on dotnet-tools.json
- restart
- move tools installation folder to C:/dotnettools
- add said folder to PATH
Does anyone have any tips?
Which version of MonoGame are you trying to use? Can you provide diagnostic logs?
I’m using 3.8.4 on Windows 11 x64 in Visual Studio.
Where can i find the error logs?
When you hit issues with the old MGCB, it always hits hard and almost always comes down to a mismatch between the MonoGame version in the dotnet-tools.json being consumed by your project and the version used in your runtime game.
As a guide:
- have a single “.config” folder with a “dotnet-tools.json” config in your solution (not your root drive, as projects can be different versions)
- Check the MonoGame version in the tools config and your runtime csproj. Make sure they match (note tools cannot use wildcards, so if you are hitting issues, then make them both a specific version)
- Try running
dotnet tool restore in your Solution, to know which tools version is being read, if it is not the version you expect, then there is a rogue config file somewhere.
- If the build is still failing, capture the MGCB failure line and run the command manually without the “/quiet” option, it should give you more detail
- Nuclear option, Create a brand new project from a template, check that builds and if it works, then migrate your solution over as there is likely “something” amis with your existing project which can be very tricky to diagnose.
If all else fails, I would suggest trying out the new Content Builder solution available in the new 3.8.5-Preview, the dotnet tooling issue is something we are moving beyond for the exact issues you are facing.
Hope that helps
I got the following error from removing the /quiet flag:
The Monogame content tools only work on a 64bit OS
However, the OS this is run on is x64 windows. Is this because mcgb somehow uses the x86 .Net SDK, if so, how can I fix this?
mgcb is compiled as anycpu. Do you have the x86 .net SDK installed?
Found the problem! Apparently the x86 version of dotnet had a higher priority in the environment variables of windows. Which meant that it called the wrong version in Visual Studio when running mcgb.
2 Likes
Glad you got it sorted, one of many reasons the older MGCB editor just has to die, the dotnet tooling use with it has been a nightmare to maintain.
Long live the Content Builder (now in preview for 3.8.5)
1 Like