Content folder breaks when building with MGCB Editor.

When I build my content folder from just this, I get a very odd and broken content folder which doesn’t allow me to load assets.

Content layout with the MGCB Editor

Actual built content folder.

Then when I actually try to load these files it can’t find them and I’m unsure of where to actually path to. The output im getting might actually be the correct output but I’m unable to path to the correct folder to load these assets.

I’m using: "Sprites\\slime" and this returns
“The content file was not found.”
“Could not find a part of the path ‘D:\Projects\Csharp\FactoryGame\bin\Debug\net6.0\Sprites\slime.xnb’.”

Does your project have the MonoGame.Content.Builder.Task NuGet reference? It should if you created it from templates.

This NuGet has a task that is invoked when your project is built copies the .xnb content builds to your project build bin/ directory.

How would I check this? I’m using the “MonoGame Cross-Platform Desktop Application” template

Check under the Dependencies node under your Project in the Solution Explorer panel. If you expand it, there should be a node called Packages that you can expand. See if its listed there

I suspect is. Now that im looking back over your original message, it may be a different issue.

Do you you have the following line in your Game1 constructor

Content.RootDirectory = "Content";

Yeah the MonoGame.Content.Builder.Task is there, but its under "Dependancies/.NET 6.0/Packages/MonoGame.Content.Builder.Task.

Yes its there although my “Game1” class is renamed to “Main”. I updated this in Program.cs as well, maybe there are other references to Game1 that I haven’t updated? But the contructor for that class has Content.RootDirectory = "Content";

I am also having problems with this… Huge folders in folders in folders, bin, debug, release, content, etc, over and over again… Every project is a huge bloated mess of file copies.

I have never figured out why all my files have to be stored in so many folders, and what it all means.
And then when something breaks, I have no idea why, or where to look…

I have no idea what the content tool does, or why it is so hard to use with visual studio.

I can make it work fine for weeks on end, but then something breaks content-wise, and I have to copy paste all my code to a new project…

All of these questions you are asking are concepts that need to be documented and explained better.

If you don’t mind being paitent a couple of days, ill prepare a more new user friendly guide/explination that covers those questions and frustrations as well as explaining the entire workflow of the content processing.

1 Like

Sure, that would be much appreciated. I’m a complete beginner so I don’t know if the content folder is supposed to be like this, I assume not as with the Content.Load() its looking for a /debug folder?

This is literally my first project with monogame and this is my first roadblock I’ve ran into.

I’ve always dreamt of something like this…

I have thought about creating an explanation using a metaphor, or mental imagery, of a scenario involving people, and what they do, who knows what, etc…

Like there is a programmer who writes code for his pictures to dance by, so he goes to see MR pipeline tool… Mr pipeline has some follow-up questions, and explains the limitations of his work…

He then somehow changes the programmers pictures into XNB files, and stores these copies in a safe space… He explains why this is important, and how to ensure their protection…

The problem here, is that CODE follows human intuition, and logic, and GAMES mirror real behavior a lot… But it is HARD to compare the content pipeline, and XNB files to anything concrete, for the brain to understand it better… It’s like nothing else, it compares to no other experience.

Keep this in mind when writing, is my tip… IDE, API, framoworks, libraries, these things are hard to learn about compared to programming.

1 Like