# ContentManager in XNA cant find any XML

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

• In the properties of your XML file, is the importer set correctly?
– me--
Oct 25, 2013 at 2:11
• When asking about exceptions, as well as the type of the exception, please provide the Message property of the exception. For example, I can get this exception type by setting the filename incorrectly, with a message: "Error loading "NewXmlFile". File not found.". But I can't be sure that's the same exception you are getting! Oct 25, 2013 at 10:38

System.String hello = Content.Load<System.String>("NewXmlFile");

To your LoadContent method. Be sure that NewXmlFile is the filename of the XML file you created, without its file extension. For example, if you used the default name given to you when creating the file, above, you should replace "NewXmlFile" with "XMLFile1".
Set a breakpoint on the line after your call to Load. Run your game, and observe in the debugger that the variable hello now contains your string.