I have an invocation logger that is intended to record all method calls along with the parameters associated with the method using XmlSerializer. It works well for most of t
The way you serialize an IEnumerable property is with a surrogate property
[XmlRoot]
public class Entity {
[XmlIgnore]
public IEnumerable Foo { get; set; }
[XmlElement, Browsable(false), EditorBrowsable(EditorBrowsableState.Never)]
public List FooSurrogate { get { return Foo.ToList(); } set { Foo = value; } }
}
It's ugly, but it gets the job done. The nicer solution is to write a surrogate class (i.e. EntitySurrogate).