System.Xml.Serialization.XmlSerializerFactory.CreateSerializer Method

Returns a derivation of the System.Xml.Serialization.XmlSerializer class that can serialize objects of the specified type into XML document instances, and vice versa. Each object to be serialized can itself contain instances of classes, which this overload can override with other classes. This overload also specifies the default namespace for all the XML elements, and the class to use as the XML root element.

Syntax

public XmlSerializer CreateSerializer (Type type, XmlAttributeOverrides overrides, Type[] extraTypes, XmlRootAttribute root, string defaultNamespace, string location, System.Security.Policy.Evidence evidence)

Parameters

type
The Type of the object that this System.Xml.Serialization.XmlSerializer can serialize.
overrides
An System.Xml.Serialization.XmlAttributeOverrides that extends or overrides the behavior of the class specified in the type parameter.
extraTypes
A Type array of additional object types to serialize.
root
An System.Xml.Serialization.XmlRootAttribute that defines the XML root element properties.
defaultNamespace
The default namespace of all XML elements in the XML document.
location
The path that specifies the location of the types.
evidence
An instance of the System.Security.Policy.Evidence class that contains credentials needed to access types.

Returns

A derivation of the System.Xml.Serialization.XmlSerializer.

Remarks

Requirements

Namespace: System.Xml.Serialization
Assembly: System.Xml (in System.Xml.dll)
Assembly Versions: 2.0.0.0, 4.0.0.0
Since: .NET 2.0