SerializationInfo.SetType Method (Type)


Sets the Type of the object to serialize.

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

member SetType : 
        type:Type -> unit


Type: System.Type

The Type of the object to serialize.

Exception Condition

The type parameter is null.

The Formatter is responsible for setting the Type of the SerializationInfo instance before passing it to GetObjectData. However, users who want to send proxies for their objects will need to change the type represented by this SerializationInfo instance. Using the SetType method is equivalent to setting both the FullTypeName and the AssemblyName.

No code example is currently available or this language may not be supported.

.NET Framework
Available since 1.1
Return to top