I'm working with MonoGame and I want to use XMLs to attach some metadata for some of my textures. I created the following class:
public class TextureData
{
public float FrameWidth;
public float FrameHeight;
}
And now I'm trying to create an XML in my content pipeline and load it. I tried writing the following XML:
<?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>
And got the following error:
error : Importer 'XmlImporter' had unexpected failure!
1> Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: Could not resolve type 'TextureData'.
I read some tutorials and in all of them whenever they use custom type they take it from external dll and reference to it. So I tried moving the class to external dll and use it from there and it works. However, it feels very messy to create a whole class library inside my original project just to reference a class from XML..
So my question is this: is it possible to use custom type from the MonoGame project itself inside XML content? eg without external dll with reference?
Thanks!