Lately I have been playing around with serializing and deserializing of objects, and I stumbled upon a very weird behavior. I was trying to serialize a certain object that was implementing the INotifyPropertyChanged Interface. I marked the object as [Serializable] and used the following method to serialize it:
1: public void SerializeNow()
2: {
3: Stream s = File.Create("Data.dat");
4: BinaryFormatter b = new BinaryFormatter();
5: b.Serialize(s, data);
6: s.Close();
7: }
Serialization is the process of saving an object onto a storage medium (such as a file, or a memory buffer) or transmiting it across a network connection link in binary form.
The .NET Framework provides an easy-to-use serialization mechanism by using the [Serializable] attribute. If so why do we need the ISerializable interface? Lets compare to see [...]
We pay for user submitted tutorials and articles that we publish. Anyone can send in a contribution
Learn More