I have an XML file that I'm trying to import into my MonoGame project using the content pipeline. I'm having trouble getting the MonoGame Pipeline tool to convert the XML file into a .xnb file before I can even run the program.
The XML file is as follows:
<?xml version="1.0" encoding="utf-8"?> <XnaContent> <Asset Type="GameObjects.ObjectInstruction"> <FrameNames> <Item>Image_1</Item> <Item>Image_2</Item> </FrameNames> <FrameSpeed>10</FrameSpeed> <HorizontalOrigin>0.5</HorizontalOrigin> <VerticalOrigin>0.5</VerticalOrigin> <HorizontalScaling>1</HorizontalScaling> <VerticalScaling>1</VerticalScaling> <HorizontalOffset>0</HorizontalOffset> <VerticalOffset>0</VerticalOffset> <Subset Null="true" /> <RotationRadians>0</RotationRadians> <Tint> <B>255</B> <G>255</G> <R>255</R> <A>255</A> <PackedValue>4294967295</PackedValue> </Tint> </Asset> </XnaContent>
The GameObjects namespace is in a Visual Studio project that creates a .dll file, and I have another MonoGame project that references GameObjects and is the one in which I'm trying to do all the content stuff.
Inside the Pipeline tool I've got a reference set to the GameObjects.dll file. This file shows up in several places, and if I pick the wrong one the Pipeline tool fails with the error "Assembly is either corrupt or built using a different target platform than this process. Reference another target architecture (x86, x64, AnyCPU, etc.) of this assembly."
If I change the reference to the .dll file in the GameObjects project folder, the Pipeline tool still fails when trying to process my XML file. The error message looks like "System.Xml.XmlException: 'Element' is an invalid XmlNodeType. Line 19, position 8." This part of the XML file would be the G field of the Tint part of the ObjectInstruction object (Tint is a Color).
I've been knocking my head against this problem and getting nowhere. How do I use the Monogame Pipeline tool with XML files? How do I get it to recognize the definition of ObjectInstruction and process the XML file into a .xnb file? I'm pretty sure the rest of my program will run if I can solve this bit. Thanks for any help.