Game Development Stack Exchange is a question and answer site for professional and independent game developers. Join them; it only takes a minute:

Sign up
Here's how it works:
  1. Anybody can ask a question
  2. Anybody can answer
  3. The best answers are voted up and rise to the top

I am trying to load premade .xnb files with the content pipeline. when I call contentManager.Load<model>("grass");, for which I have a "grass.xnb" file in the corresponding directory, it crashes with: "Error loading "grass_0". File not found."

The grass.xnb file was created using a MSBuild wrapper to build the .fbx files. I initialized the content manager with : contentManager = new ContentManager(mainXnaWindow.Services, projectFileOpen + "../Assets/XNB/")); I am pretty sure the content manager has the right directory, because when I deleted "grass.xnb" from the directory, It just told me "Error loading "grass" File not found"

Does anyone know why it could be adding a "_0" to the name?

Edit: I forgot to include a built version of th texture associated with it. Problem Solved.

share|improve this question
You need to say something about this grass_0 file. It's the thing causing the error so we need to know about it (currently we know nothing). We also need to know what it has to do with myModel.xnb, unless that was just a roundabout way of saying you call contentManager.Load<model>("grass");. – doppelgreener Jun 8 '11 at 7:44
Sorry about that. I've cleared up and added some details. – sFuller Jun 8 '11 at 7:59
maybe grass_0 is it's texture and it needs it to completly load model? – Ali.S Jun 8 '11 at 8:35
Haha that solves the problem. Thanks! – sFuller Jun 8 '11 at 8:44
Could you post the answer and accept it? – Jonathan Connell Jun 8 '11 at 9:04
up vote 1 down vote accepted

The .xnb file wouldn't load because it was looking for another .xnb file, the texture to go with the model.

I fixed this by making sure that all of the built .xnb files were in the directory I was loading from.

share|improve this answer

Your Answer


By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.