As promised in the previous post “How to implement a generic Shallow-Clone for an object in C#” this will demonstrate deep-cloning objects that don’t explicitly support the behavior. Before I continue I will again state that I don’t recommend this approach. It will be many times slower than a properly implemented Clone() and can cause [...]

 

This implementation makes heavy use of the FormatterServices object used by serialization: http://msdn.microsoft.com/en-us/library/system.runtime.serialization.formatterservices_members.aspx It provides several helpful methods in this case that are aware of custom serialization options like [NonSerialized]. In the case of an object not being marked [Serializable] you have to create field list manually. Here is an example shallow object clone: using [...]