Content pipeline: could not load asset as non-content file

Whenever I try to load a simple PNG image I get the error “could not load a asset as a non-content file”. I run Xamarin Studio on OS X and the project is just the basic MonoGame Mac Application template. The steps I followed were:

  1. Open Content.mgcb using the Content Pipeline Tool
  2. Add the image file (simply called “a”) and set its BuildAction to “Copy” (otherwise build fails)
  3. Save and then build the file

The build succeeds, but I get the aforementioned error when I add this code and run the project:

Texture2D a = Content.Load<Texture2D>("a");

I read something about needing to add a .xnb file to the project, but it doesn’t seem like such a file is being generated. Other sources completely ommit any mention of the .xnb or even the need to build the .mgcb file in the first place.

So, I’m pretty confused right now about how I’m supposed to use the content pipeline. Can anyone help clear this up?

1 Like

Update: downloaded the Platformer2D sample and added the NuGet Monogame.Framework.MacOS package to it because it wouldn’t build otherwise. When I run it I get the exact same error when trying to load assets…