31. March 2026 · Categories: .NET

If you want to serialize a polymorphic property to/from XML using XMLSerializer, you need to provide it with the required info about the derived classes. This is done with XmlElement for individual elements, and with XmlArrayItem for list items.