When should I use XML Serialization vs. Binary Serialization in the .NET framework?

前端 未结 3 1554
Happy的楠姐
Happy的楠姐 2020-12-31 05:39

I\'m confused - when should I be using XML Serialization and when should I be using Binary Serialization in the .NET framework?

3条回答
  •  误落风尘
    2020-12-31 05:57

    If you want user friendly or cross platform output, then use XML. Also, XML serialization use public fields and properties to serialize and you can change/reformat output by using attributes and custom serialization on class level if you whant. Bin.Ser. uses private fields to serialize.

提交回复
热议问题