Follow Up Question: I noticed with the
binaryformatter that all I had to do
was mark the oject as serializable.
Looks like with the DataContracts I
have to mark each and every property I want serialized.
Is that correct?
How do I serialize my object to a file to where I can read and make changes to my serialized object (it’s not binary but …?)
You can serialize to XML, using the
DataContractSerializer(or the olderXmlSerializer).You can also serialize to JSON using the
DataContractJsonSerializer, if you find XML too verbose. See here.Both formats are textual, but they are not clear text. I don’t believe you can get a textual representation that will be clear text (as you require delimiters between different members, properties and values).