Export (0) Print
Expand All

ObjectManager.RegisterObject Method (Object, Int64)

Registers an object as it is deserialized, associating it with objectID.

Namespace:  System.Runtime.Serialization
Assembly:  mscorlib (in mscorlib.dll)

public virtual void RegisterObject(
	Object obj,
	long objectID


Type: System.Object

The object to register.

Type: System.Int64

The ID of the object to register.


The obj parameter is null.


The objectID parameter is less than or equal to zero.


The objectID has already been registered for an object other than obj.

ObjectManager retains information about both the object and its ID. Later during deserialization, GetObject can be used to determine whether a particular object ID has already been deserialized, or whether it is a forward reference to an object that has not yet been deserialized.

.NET Framework

Supported in: 4.6, 4.5, 4, 3.5, 3.0, 2.0, 1.1, 1.0

.NET Framework Client Profile

Supported in: 4, 3.5 SP1

Windows 8.1, Windows Server 2012 R2, Windows 8, Windows Server 2012, Windows 7, Windows Vista SP2, Windows Server 2008 (Server Core Role not supported), Windows Server 2008 R2 (Server Core Role supported with SP1 or later; Itanium not supported)

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

© 2014 Microsoft