Scenarios in which Xml Serialization fails in .NET.

I would like to know the most common scenarios in which xml serialization may fail in .NET.

+5
source share
6 answers

I think mostly XmlSerializerhere:

  • it is limited to tree data; it cannot handle full object graphs
  • he is limited to public members, in public classes
  • he can't really do much with objectmembers
  • he has some disadvantages regarding generics
  • like many serializers, it will not affect the properties of an instance in a collection (first of all, bad practice).
  • xml ( )

DataContractSerializer , :

  • .NET 3.0 ( 2.0)
+4
+3

+1

shadow , , . , .

+1

TimeSpanobjects cannot be serialized. IDictionary-Additional types cannot be serialized (although they can be serialized with some manual massage).

0
source

AFAIK, classes marked as [Deprecated] are not serialized by XmlSerializer since .NET 2.0

0
source

All Articles