I should preface this by saying I’m new to MonoGame and programming in general.
I want to store the data for the levels in my game as XML files in the Content Pipeline. Currently, all my classes are inside of one Project. The XML file I’m trying to load is the following:
<?xml version="1.0"?>
<XnaContent xmlns:ns="Microsoft.Xna.Framework">
<Asset Type="NotAGame.Room">
<tileSet>
<Tile>
<SpriteID>brick</SpriteID>
<Position>
<X>64</X>
<Y>0</Y>
</Position>
<isSolid>true</isSolid>
<collisionMask>
<X>0</X>
<Y>0</Y>
<Width>32</Width>
<Height>32</Height>
<Location>
<X>0</X>
<Y>0</Y>
</Location>
<Size>
<X>32</X>
<Y>32</Y>
</Size>
</collisionMask>
</Tile>
<Tile>
<SpriteID>brick</SpriteID>
<Position>
<X>32</X>
<Y>0</Y>
</Position>
<isSolid>true</isSolid>
<collisionMask>
<X>32</X>
<Y>0</Y>
<Width>32</Width>
<Height>32</Height>
<Location>
<X>32</X>
<Y>0</Y>
</Location>
<Size>
<X>32</X>
<Y>32</Y>
</Size>
</collisionMask>
</Tile>
<Tile>
<SpriteID>brick</SpriteID>
<Position>
<X>0</X>
<Y>32</Y>
</Position>
<isSolid>true</isSolid>
<collisionMask>
<X>0</X>
<Y>32</Y>
<Width>32</Width>
<Height>32</Height>
<Location>
<X>0</X>
<Y>32</Y>
</Location>
<Size>
<X>32</X>
<Y>32</Y>
</Size>
</collisionMask>
</Tile>
</tileSet>
<randomMovingNpcs>
<RandomMovingNPC>
<SpriteID>orb</SpriteID>
<Position>
<X>32</X>
<Y>32</Y>
</Position>
<isSolid>true</isSolid>
<collisionMask>
<X>32</X>
<Y>32</Y>
<Width>32</Width>
<Height>32</Height>
<Location>
<X>32</X>
<Y>32</Y>
</Location>
<Size>
<X>32</X>
<Y>32</Y>
</Size>
</collisionMask>
<originPosition>
<X>32</X>
<Y>32</Y>
</originPosition>
<velocity>
<X>0</X>
<Y>0</Y>
</velocity>
<maxDistance>64</maxDistance>
<movement>
<X>0</X>
<Y>0</Y>
</movement>
<timer>92</timer>
</RandomMovingNPC>
</randomMovingNpcs>
<player>
<SpriteID>security_agent</SpriteID>
<Position>
<X>112</X>
<Y>134</Y>
</Position>
<isSolid>true</isSolid>
<collisionMask>
<X>112</X>
<Y>134</Y>
<Width>32</Width>
<Height>32</Height>
<Location>
<X>112</X>
<Y>134</Y>
</Location>
<Size>
<X>32</X>
<Y>32</Y>
</Size>
</collisionMask>
<Velocity>
<X>0</X>
<Y>0</Y>
</Velocity>
</player>
<camera2d>
<matrix>
<M11>2</M11>
<M12>0</M12>
<M13>0</M13>
<M14>0</M14>
<M21>0</M21>
<M22>2</M22>
<M23>0</M23>
<M24>0</M24>
<M31>0</M31>
<M32>0</M32>
<M33>2</M33>
<M34>0</M34>
<M41>0</M41>
<M42>0</M42>
<M43>0</M43>
<M44>1</M44>
<Backward>
<X>0</X>
<Y>0</Y>
<Z>2</Z>
</Backward>
<Down>
<X>-0</X>
<Y>-2</Y>
<Z>-0</Z>
</Down>
<Forward>
<X>-0</X>
<Y>-0</Y>
<Z>-2</Z>
</Forward>
<Left>
<X>-2</X>
<Y>-0</Y>
<Z>-0</Z>
</Left>
<Right>
<X>2</X>
<Y>0</Y>
<Z>0</Z>
</Right>
<Translation>
<X>0</X>
<Y>0</Y>
<Z>0</Z>
</Translation>
<Up>
<X>0</X>
<Y>2</Y>
<Z>0</Z>
</Up>
</matrix>
<position>
<X>0</X>
<Y>0</Y>
</position>
<zoom>2</zoom>
<size>
<X>0</X>
<Y>0</Y>
</size>
</camera2d>
</Asset>
</XnaContent>
Currently, when I try to run the game, I get the following error: “Unable to load one or more of the requested types. Retrieve the Loader.Exceptions property for more information”.
The XML file was created by serializing an instance I created through code using an XmlSerializer. I’m completely stumped… I’ve tried referencing the Monogame.Framework.Content.Pipeline.dll but that didn’t work.