monogame content tool not working. Now with pics.

For 2 days of a new PC, I can’t load any content, because the mgcb tool won’t run.

I can write and run code just fine, I just can’t add content.

As you can see here, BOTH my visual studio versions even lack the ICON to indicate that it recognizes mgcb files, and has a program associated with them.

And as you can see below, at least in the 2022 version of visual studio, I can actually set the tool as the default one, but that changes nothing. Still can’t edit the file, so I can’t add content.

I’m just an end user of monogame, I don’t know anything about json or nuget or gitub, or special command line paths, but I have made SEVERAL games with monogame, so I feel like this should not be an issue, and there must be some EDGE CASE reason why I’m having these problems…
But then, this is new clean windows PC, and I am a typical user. I haven’t even set a wall paper on this machine… What gives.

at
C:\Users*my_user*.nuget\packages\monogame.content.builder.task\3.8.0.1641\tools\netcoreapp3.1\any
I can find an app with the NAME mgcb, but it does nothing when I run it, and also has no icon. But it is the only app I can find with that sort of name.

mgcb is for building content, but it’s not the editor with GUI you are looking for. That one should have a path like this:

C:\Users\username.nuget\packages\dotnet-mgcb-editor-windows\3.8.1.303\tools\net6.0\any\mgcb-editor-windows-data\mgcb-editor-windows.exe

By the way you can also hand-edit .mgcb files quite easily.

username/.nuget/packages does not contain a folder/dir called dotnet-mgcb-editor-windows.

C:\Users\thisUser.nuget\packages\monogame.content.builder.task\3.8.0.1641\tools\netcoreapp3.1\any DOES contain a program called gmcb, but the path you gave does not exist.

Oh, you’re still using 3.8.0. The path I gave you is for 3.8.1. Maybe the easist fix for your problem is to just upgrade to 3.8.1. Should be easy: MonoGame/migrate_38.md at develop · MonoGame/MonoGame · GitHub

oh, I see. I’ll check if that helps.

I think pre 3.8.1 the editor would be here somewhere: C:\Users\userName\.dotnet\tools

Yes I found it there, but i just opens a console window, and closes instantly.

I have verified that I have visual studio 2022, I have .net 6, and I have installed the monogame template through the extensions menu in visual studio. Today, even.

I can start new monogame projects, edit code and see the corn blue window, load variables, rectangles, spriteBatch, all that stuff…

It’s JUST the content tool not working.

Am I supposed to take steps to install it, or configure it? I don’t remember doing that in the past.

I would settle for this, but I was going to teach this to my nephew, and I would just like to have the same tools he’s using, so I don’t overwhelm him.

If you create a new project from the template, it should have tool restore set up like in the migration guide I linked above. This should install the editor here: C:\Users\username\.nuget\packages\dotnet-mgcb-editor-windows\3.8.1.303\tools\net6.0\any\mgcb-editor-windows-data\mgcb-editor-windows.exe

If it’s not there, something went wrong. Does the project you are building really have tool restore? Do you see some message in the output window about restoring tools?

EDIT: Are you maybe using an older extension that creates pre 3.8.1 projects?

Sorry, they put a minimum 4 hour delay on my response…

Well, I just un installed monogame and even visual studio 19 and 22… Then re installed VS22 and added monogame templates through the drop down menu in Visual Studio.

When I create new projects, everything is fine, except I cannot use the content tool to open the pre-generated, brand new content file, Content.mgcb…

All on a fresh install, where I picked the front page standard install of Visual studio AND monogame.

I’m not seeking backwards compatability with old projects, not migrating or updating, nor do I have ANY special requirements. I’m trying to get barebones vanilla monogame, at a consumer level.

I have a hot-fix of just STREAMING in textures, but I hear the tool optimizes the load process, and I want that for the kids I teach. They should get the current standard, not so they can get help from other users and forums.

Ok - so, it works now. For no reason.

I have been just tinkering to the max, and suddenly its working.

It still does not show an icon for mgcb files, instead just a white sheet not the red m, but it DOES allow for editing them now.

of all the pages and guides, something must have shaken it loose.

In Visual Studio, right-click on the Content.mgcd file, select “Open with…”;
image

Then click “Add…” button;
image

In Programs, go get your mgcb-editor-…

  • For 3.8.1, it must be:
    C:\Users\username\.nuget\packages\dotnet-mgcb-editor-windows\3.8.1.303\tools\net6.0\any\mgcb-editor-windows-data\mgcb-editor-windows.exe
  • For 3.8.0, it must be:
    C:\Users\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

Click OK, and Set as Default.

It should work (don’t care about the icon … it’s just an icon :wink: )

I have suffered similar trials, with multiple conflicting advice.
I am unable to get the icon back despite registry hacks, setting file associations etc, but this method seems to work. (VS2022 latest update, Monogame latest 3.8.1)

  1. Open terminal/cmd/powershell inside Content folder:
  2. Type: mgcb-editor (Enter)
  3. This should get instruction: use “dotnet tool restore” to make the “mgcb-editor-windows” command available.
  4. Type: dotnet tool restore (Enter)
  5. Double-click on Content.mgcb

I assume this is breaking all the rules/advice on NOT using a global editor, but if it works, use it.

1 Like