Serializable attribute necessary when serializing

Collapse
This topic is closed.
X
X
 
  • Time
  • Show
Clear All
new posts
  • Gabriel Lozano-Morán

    Serializable attribute necessary when serializing

    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


  • Gabriel Lozano-Morán

    #2
    Re: Serializable attribute necessary when serializing

    Ignore this post I found the article on the MSDN:


    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.Memberwi seClone()

    Gabriel Lozano-Morán


    Comment

    Working...