error: Importer ‘XmlImporter’ had unexpected failure!
Microsoft.Xna.Framework.Content.Pipeline.InvalidContentException: The Xml element Keys is required!
ved Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.ReflectiveSerializer.Deserialize(IntermediateReader input, ContentSerializerAttribute format, Object existingInstance)
ved Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateReader.ReadRawObject[T](ContentSerializerAttribute format, ContentTypeSerializer typeSerializer, T existingInstance)
ved Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateReader.ReadObject[T](ContentSerializerAttribute format, ContentTypeSerializer typeSerializer, T existingInstance)
ved Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateReader.ReadObject[T](ContentSerializerAttribute format)
ved Microsoft.Xna.Framework.Content.Pipeline.Serialization.Intermediate.IntermediateSerializer.Deserialize[T](XmlReader input, String referenceRelocationPath)
ved Microsoft.Xna.Framework.Content.Pipeline.XmlImporter.Import(String filename, ContentImporterContext context)
ved Microsoft.Xna.Framework.Content.Pipeline.ContentImporter`1.Microsoft.Xna.Framework.Content.Pipeline.IContentImporter.Import(String filename, ContentImporterContext context)
ved MonoGame.Framework.Content.Pipeline.Builder.PipelineManager.ProcessContent(PipelineBuildEvent pipelineEvent)
This is what the Keys property looks like in the XNA Curve class:
public CurveKeyCollection Keys { get; }
CurveKeyCollection contains this property:
public CurveKey this[int index] { get; set; }
These are the 5 properties in CurveKey class:
public CurveContinuity Continuity { get; set; }
public float Position { get; }
public float TangentIn { get; set; }
public float TangentOut { get; set; }
public float Value { get; set; }
This is what it apparently fails to deserialize… is it because some of the properties only have a public setter, but not a public getter?
The Keys you have looks like a ToString() output to me - I’m not great on XML (still getting to the grips of it) but you might need to break it down into the actual properties. (brackets removed - not sure how to display angle brackets) - When I mess with XML I just serialize and deserialize my class - not used monogame yet. Hope this helps.
Keys
CurveKey
Position VALUE /Position
TangentIn VALUE /TangentIn
TangentOut VALUE /TangentOut
Value VALUE /Value
Continuity
Property1 VALUE /Property1
Property2 VALUE /Property2
/Continuity
/CurveKey
CurveKey
...
/CurveKey
/Keys
namespace Ballz.Shared.Entities
{
[Serializable]
public class HistoryRegion
{
public string Key;
public int X;
public int Y;
[XmlElement("Color")]
public Color Color;
[XmlIgnore]
public string test { get; private set; }
public HistoryRegion()
{
}
public HistoryRegion(string key, int x, int y, Color regionColor)
{
Key = key;
X = x;
Y = y;
Color = regionColor;
}
}
}