[FIXED] ContentLoadException when using project on another computer

Hi there

I recently copied my MonoGame 3.6 (not 3.6, see edit) working project on a USB stick, and placed it on another computer.
There are no errors shown in the visual studio error list, but I get a ContentLoadException for every texture file when launching the project.

Example:

        mouseTexture = new Image(content.Load<Texture2D>(@"Images/Mouse_Texture"), new Point(3, 3), new Point(0, 0));

-> This image is located here: …Content\Images\Mouse_Texture.png (in debug and release folder)
-> Build action is set to: “Content”
-> Copy to output directory is set to: “Copy if newer”

I tried moving a project to another computer a long time ago on MonoGame 3.4, and that worked perfectly. I can’t seem to find the problem here.
Note: I have the same error with all the projects.

EDIT: My old computer had MonoGame 3.5, not 3.6.

Thanks in advance

UPDATE
It works when placing all the texture (.png) files in the Content.mgcb (content pipeline) file. Why could I use normal .png’s before, and not now?

Picture:
Before:

Now:

The ContentManager no longer loads raw assets in 3.6, only .xnb’s. If you do not want to use the content pipeline, you can load raw images using Texture2D.FromStream

1 Like

Oh, I see, But how did I manage to use the raw .png’s on my other pc with MonoGame 3.6?

Also: Wouldn’t this affect my modding system in my project: Users could add a texture file to a certain folder, and the game would load that file into the project.
Is it still possible for “outside” users to insert textures into the content pipeline?

Thanks for your help!

Probably was an older version. There’s no way that worked in 3.6.

There’s been some discussion about modding and the content pipeline before. I can see 3 nice solutions:

  • Include MGCB.exe with your game, make a simple front-end with branding for your game and limited options for nice UX (alternatively you can just ship the Pipeline Tool with the game; way less work, but not as neat) and let users build the assets into .xnb’s before adding them.
  • Include MGCB.exe with your game, let users add raw assets and when discovering those assets (probably when starting up the game or something) build them into .xnb’s.
  • Use raw assets (FromStream).
1 Like

Weird. I downloaded the new MonoGame, installed it and deleted the old MonoGame. I even had to edit some things in my code to get it working again. I think I’ll never know why…

EDIT: My old version was 3.4 to 3.5, not 3.5 to 3.6. You were right.

This worked. Thank you so much!

1 Like