[SOLVED] Content.Load XML with a custom class in the XML

Hi
I’m porting my XNA game.
My game and editor share a common class library.
The editor reads and writes game data for each of the custom classes from that class library to/from XML using IntermediateSerializer.
I’ve got part working; tonight I started on the in-game end of things.

In XNA I built the XML to XNB. This “just worked” - I added the XML to my content project and they magically ended up a an XNB file.
My game would then load that XNB using Content.Load.

Im trying to build the same XML n Monogame. The content builder is giving me the error " error : Importer ‘XmlImporter’ had unexpected failure! - Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: Could not resolve type ‘RpgLibrary:RolePlayingGame’." (repeated for each file/class)

In the MGCB file, the XML’s have “Xml Importer - Monogame” as the Importer, and “No Processing required” for the Processor.

Is this correct? If we arent processing the XML, why does the content processor need to know the class type?

Can I do this with MonoGame? Is there a better approach? Do I need a custom XML processor that references my class library so it knows those classes? I can probably do this, but dont want to go that route if its not the “right” thing to do.

Any help would be greatly appreciated, this would be a showstopper for Monogame if I cant get this working, and I really dont want that :slight_smile:

EDIT: I wen t back and checked my XNA project. My Content Project had a reference to the class library. So it knew the classes. Ill look into doing the same here - I probably missed this reviewing documentation. If so, sorry!

[SOLUTION] : Well, this is embarrassing and what I get for posting at 1:30 AM cause I was hoping for an answer in the morning. To reference a DLL, click on the Content Project in the pipeline tool under properties select References and navigate to your DLL. Include it and alls well. Sorry. Mods, you can delete this if you wish.

2 Likes