I have a
List<object> which contains various different data types including
Vector3. Previously, in XNA 4.0, I was able to use an
XmlSerializer to export all of these data types to (and import them from) an XML document. Now, in MonoGame 3.0, it no longer works with
Vector3. This is the error that I get for all of them:
System.InvalidOperationException: 'There was an error generating the XML document.'
InvalidOperationExcetion: The type Microsoft.Xna.Framework.Rectangle was not expected. Use the XmlInclude or SoapInclude attribute to specify types that are not known statically.
I have tried putting
[XmlInclude(typeof(Rectangle))] right above my class declaration, but this does nothing. Am I doing it wrong? Perhaps this has something to do with the fact that my
List is of the generic