This documentation is archived and is not being maintained.

ObjectManager Class

Keeps track of objects as they are deserialized.

For a list of all members of this type, see ObjectManager Members.


[Visual Basic]
Public Class ObjectManager
public class ObjectManager
public __gc class ObjectManager
public class ObjectManager

Thread Safety

Any public static (Shared in Visual Basic) members of this type are thread safe. Any instance members are not guaranteed to be thread safe.


During deserialization, the Formatter queries the ObjectManager to determine whether a reference to an object in the serialized stream refers to an object that has already been deserialized (a backward reference), or to an object that has not yet been deserialized (a forward reference). If the reference in the serialized stream is a forward reference, then the Formatter can register a fixup with the ObjectManager. If the reference in the serialized stream is a backward reference, the Formatter immediately completes the reference. Fixup refers to the process of finalizing object references not already completed during the object deserialization process. After the required object has been deserialized, the ObjectManager will complete the reference.

The ObjectManager follows a set of rules that dictate the fixup order. All objects that implement ISerializable or have an ISerializationSurrogate can expect to have all the objects that they transmitted through SerializationInfo available when the object tree is deserialized. However, a parent object cannot presume that all its child objects will be fully completed when it is fully deserialized. All child objects will be present but not all the grandchild objects will necessarily be present. If an object needs to take certain actions that depend on executing code on its child objects, it can delay these actions, implement the IDeserializationCallback interface, and execute the code only when it is called back on this interface.


Namespace: System.Runtime.Serialization

Platforms: Windows 98, Windows NT 4.0, Windows Millennium Edition, Windows 2000, Windows XP Home Edition, Windows XP Professional, Windows Server 2003 family

Assembly: Mscorlib (in Mscorlib.dll)

See Also

ObjectManager Members | System.Runtime.Serialization Namespace