Serializable attribute necessary when serializing

  • Thread starter Gabriel Lozano-Morán
  • Start date
G

Gabriel Lozano-Morán

I always thought you could serialize instances of classes marked WITHOUT
Serializable attribute for a shallow copy and for a deep copy you needed to
mark the class. Has this been changed of was this never the case? Currently
at work running .NET 1.1 without SP1.

Gabriel Lozano-Morán
 
G

Gabriel Lozano-Morán

Ignore this post I found the article on the MSDN:
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/dnadvnet/html/vbnet09252001.asp

I misinterpreted the following sentence:
"By default, objects are not serializable-they are unavailable for deep
serialization. Objects are always available for shallow serialization, since
that technique merely scans the object's public interface for read-write
property methods.

To enable deep serialization, we need to apply this <Serializable()>
attribute. An advanced alternative to using this attribute is to implement
the ISerializable interface, which I'll discuss later in the column."

I guess this is referring to Object.MemberwiseClone()

Gabriel Lozano-Morán
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Top