Could not load Spritefont asset as a non-content file!


i saw several topics on this subject, but nothing works.

I have a font (at start font.spritefont)
I defined :
Content.RootDirectory = “Content”;

And my SpriteFont font :
font = Content.Load(“Spritefont/font”);

I defined font.spritefont to content type and copy if newer.
If i execute i get a :
Microsoft.Xna.Framework.Content.ContentLoadException: Could not load Spritefont/font asset as a non-content file!

If i put this spritefont to a XNA project, compile it, and get XNB generate. I have exactly the same :’(

What can i do ?

EDIT : my spritefont is in Asset/Content/Spritefont and i m on android :slight_smile:

Your MonoGame project cannot load the .spritefont file. The .spritefont file is used by the Content Pipeline to generate a .xnb file that is included with your project and loaded by the ContentManager.

Thanks KonajuGames, so i replaced font.spritefont with font.xnb (generate by an XNA project with this font.spritefont)
But the result is the same, he doesn t works with font.xnb and with same property (content + copy if newer)

EDIT : I work on VS2013, i start with an blank android app, i add monogame to this project with nuget. All works great for texture2D (my character move and follow my finger etc…). Now i have doubt : what you called Content Pipeline is not integred in my project with monogame ? Instead of have a Content folder under Asset folder, maybe i had to add a Managing content to my project to have the content pipeline ? (Despite i’m on Android ? )
Like this :

Here is my project

My font.xnb configuration :

It s write in french : content and always copy

And my error :

It s a new project there is only this, it a monogame 3.3 android :slight_smile:
What is wrong ? What did i don t understand ?

Thanks :slight_smile:

EDIT : Obviously, i have config my app with : Content.RootDirectory = “Content”;
I have try to put Content folder and font.xnb in assert folder too, but don t work too …

You .xnb /game content need to go in the Assets/Content folder and have a build action of AndroidAsset.

Awesome ! It works great ! Thanks :smiley:
Ressource have to be in property Android Content on Android MonoGame !!