Where do I place XNA content pipeline references?

Posted by Zabby Wabby on Game Development See other posts from Game Development or by Zabby Wabby
Published on 2012-03-29T04:59:27Z Indexed on 2012/03/29 5:42 UTC
Read the original article Hit count: 459

Filed under:
|
|

I am relatively new to XNA, and have started to delve into the use of the content pipeline. I have already figured out that tricky issue of adding a game library containing classes for any type of .xml file I want to read.

Here's the issue. I am trying to handle the reading of all XML content through use of an XMLHandler object that uses the intermediate deserializer. Any time reading of such data is required, the appropriate method within this object would be called. So, as a simple example, something like this would occur when a character levels:

public Spell LevelUp(int levelAchived)
{
    XMLHandler.FindSkillsForLevel(levelAchived);
}

This method would then read the proper .xml file, sending back the spell for the character to learn. However, the XMLHandler is having issues even being created. I cannot get it to use the using namespace of Microsoft.Xna.Framework.Content.Pipeline. I get an error on my using statement in the XMLHandler class:

using Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate;

The error is a typical reference error:

Type or namespace name "'Pipeline' does not exist in the namespace 'Microsoft.Xna.Framework.Content' (are you missing an assembly reference?)"

I THINK this is because this namespace is already referenced in my game's content. I would really have no issue placing this object within my game's content (since that is ALL it deals with anyways), but the Content project does not seem capable of holding anything but content files.

In summary, I need to use the Intermediate Deserializer in my main project's logic, but, as far as I can make out, I can't safely reference the associated namespace for it outside of the game's content. I'm not a terribly well-versed programmer, so I may be just missing some big detail I've never learned here. How can I make this object accessible for all projects within the solution? I will gladly post more information if needed!

© Game Development or respective owner

Related posts about XNA

Related posts about Xml