c# - Is it possible to serialize a custom struct as an xml attribute?

Is is possible to serialize a custom struct as an xml attribute?Sample code:public class Dummy<T>{ private Dummy() { } public Dummy(T item1) { Item1 = item1; Item2 = item1; } public T Item1 { get; set; } [XmlAttribute] public T Item2 { get; set; }}public struct Meh{ public int Prop { get; set; }}[Test]public void XmlMehTest(){ var meh = new Meh{Prop = 1}; var dummy = new Dummy<Meh>(meh); using (var writer = new StringWriter()) { var serializer = new XmlSerializer(dummy.GetType...Read more