ContentManager in XNA cant find any XML
Posted
by
user36385
on Game Development
See other posts from Game Development
or by user36385
Published on 2013-10-25T00:04:09Z
Indexed on
2013/10/25
4:17 UTC
Read the original article
Hit count: 447
Im making a game in XNA 4 and this is the first time I'm using the Content loader to initialize a simple class with a XML file, but no matter how many guide I follow, or how simple or complicated is my XML File the ContentManager cant find the file; the Debug keep telling me: "A first chance exception of type 'Microsoft.Xna.Framework.Content.ContentLoadException' occurred in Microsoft.Xna.Framework.dll". I'm really confuse because I can load SpriteFonts and Texture2D without a problem ...
I create the following XML (the most basic Xna XML):
<?xml version="1.0" encoding="utf-8" ?>
<XnaContent>
<Asset Type="System.String">Hello</Asset>
</XnaContent>
and I try to load it in the LoadContent method in my main class like this:
System.String hello = Content.Load<System.String>("NewXmlFile");
There is something I'm doing wrong? I really appreciate your help
© Game Development or respective owner