Serializable attribute is not related to XmlSerializer.

.Net has several methods of serialization and sometimes it causes a lot of confusion even for experienced programmers.
I believe the best article to describe the different methods is  Aaron Skonnard’s
Serialization in Windows Communication Foundation(MSDN Magazine > Issues > 2006 > August) (by some reason it’s not highly rated by Google and other articles are coming first for Serialization related requests)

There is also a brief comparison table in StackOverflow What are the differences between the XmlSerializer and BinaryFormatter.


I’ve recently read a good article XmlSerializer vs DataContractSerializer: Serialization in Wcf, but noticed that it is incorrectly describe SerializableAttribute.
[Serializable].is used by   System.Runtime.Serialization. (BinaryFormatter or obsolete SoapFormatter) and also by  DataContractSerializer/NetDataContractSerializer to be compatible with .Net Remoting.
However it is not used by XmlSerializer .XmlSerializer can operate on any public type without any special attributes.

 

posted @ Friday, September 16, 2011 11:40 PM
Print

Comments on this entry:

No comments posted yet.

Your comment:



(not displayed)


 
 
 
 
 

Live Comment Preview:

 
«May»
SunMonTueWedThuFriSat
293012345
6789101112
13141516171819
20212223242526
272829303112
3456789