Search code examples
c#visual-studio-2015monogame

Content Pipeline not working despite file existing in expected locations


I've been trying to figure out why the content pipeline tool isn't allowing me to load textures and spritefonts.

My MainGame constructor:

    public MainGame()
    {
        _graphics = new GraphicsDeviceManager(this);
        Content.RootDirectory = "Content"; //Content folder
        _graphics.SupportedOrientations = DisplayOrientation.LandscapeRight;
        _textureAggregate = new TextureAggregate();
    }

This is the error (ContentLoadException: The content was not found): Error

Finally, my project folder structure:

Structure

Now, the defaultfont.xnb is being created by Content.mgcb to the ~/Content/bin folder, I've just copy-pasted it to /Content attempting to get the project to recognize at least this one file. Note that the stream is working just fine (but I don't know if that's the right way to load textures now?).

I'm looking for anything else that I might not know about that requires configuration in order to get my project to recognize these files.


Solution

  • As is turns out, I didn't correctly remember the details of installing monogame and xamarin, and had created the project as an openGL game (the little icon is the same after creation on a compromised system so I thought nothing of it).

    I blame this on having just redeployed my dev environments and had managed to install the monogame pipeline tool but none of the templates, so searches for the monogame project template type went nowhere but I could still create the content project in the Content folder.

    I happened across all the same classes and objects I needed to do basic work without getting compile-time errors via nuget.

    So, if anyone else is having a real hard time with this, make sure you installed MonoGame and are working with the templates and didn't mistakenly create an opengl game like this idiot :)