This documentation is archived and is not being maintained.

DataContractSerializer.KnownTypes Property

Gets a collection of types that may be present in the object graph serialized using this instance of the DataContractSerializer.

Namespace: System.Runtime.Serialization
Assembly: System.Runtime.Serialization (in system.runtime.serialization.dll)

public ReadOnlyCollection<Type> KnownTypes { get; }
/** @property */
public ReadOnlyCollection<Type> get_KnownTypes ()

public function get KnownTypes () : ReadOnlyCollection<Type>

Not applicable.

Property Value

A ReadOnlyCollection that contains the expected types passed in as known types to the DataContractSerializer constructor.

The KnownTypes property provides the set of known types that are used for serialization and deserialization. For example, if an instance of the Hashtable class contains instances of a Person class, you should add the Person type to an instance of the List class and use the instance to construct an instance of the DataContractSerializer. If you know of other types to add to the Hashtable, then add those types to the collection.

Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition

The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.

.NET Framework

Supported in: 3.0
Show: