I have the following class:
public class TextureData
{
public float FrameWidth;
public float FrameHeight;
}
And I try to create an XML with it, like so:
<?xml version="1.0" encoding="utf-8"?>
<XnaContent xmlns:ns="Microsoft.Xna.Framework">
<Asset Type="TextureData">
<FrameWidth>0.2</FrameWidth>
<FrameHeight>0.2</FrameHeight>
</Asset>
</XnaContent>
However, I'm getting the following error:
error : Importer 'XmlImporter' had unexpected failure!
1> Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: Could not resolve type 'TextureData'.
Now in all the MonoGame tutorials about using XMLs with custom types, I always see they use external dll and add reference to it from the content root properties. I tried it, and it works. However, having to create additional project that generate external dll just so I can access a single class from XMLs seems very messy to me.
So my question is - Is it possible to use XML and reference to a class that's defined in the same project, and not in external dll? I realize there might be sort of a chicken & egg problem (what compiles first, the content or the project), but I'm wondering if its still possible somehow.
Thanks! 