Export (0) Print
Expand All

ObjectManager.RegisterObject Method (Object, Int64, SerializationInfo)

Registers an object as it is deserialized, associating it with objectID, and recording the SerializationInfo used with it.

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

public void RegisterObject(
	Object obj,
	long objectID,
	SerializationInfo info


Type: System.Object

The object to register.

Type: System.Int64

The ID of the object to register.

Type: System.Runtime.Serialization.SerializationInfo

The SerializationInfo used if obj implements ISerializable or has a ISerializationSurrogate. info will be completed with any required fixup information and then passed to the required object when that object is completed.


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 the information about both the object and its ID. Later during deserialization, you can use GetObject to discover whether a particular object ID has already been deserialized, or if 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

.NET Framework Client Profile

Supported in: 4, 3.5 SP1
© 2015 Microsoft