Export (0) Print
Expand All

XmlSerializer.Serialize Method (Object, XmlSerializationWriter)

This API supports the .NET Framework infrastructure and is not intended to be used directly from your code.

Serializes the specified Object and writes the XML document to a file using the specified XmlSerializationWriter.

Namespace:  System.Xml.Serialization
Assembly:  System.Xml.Serialization (in System.Xml.Serialization.dll)

protected virtual void Serialize(
	Object o,
	XmlSerializationWriter writer
)

Parameters

o
Type: System.Object
The Object to serialize.
writer
Type: System.Xml.Serialization.XmlSerializationWriter
The XmlSerializationWriter used to write the XML document.

ExceptionCondition
NotImplementedException

Any attempt is made to access the method when the method is not overridden in a descendant class.

Platform Notes

Silverlight for Windows Phone Silverlight for Windows Phone

 The XmlSerializer.Serialize method throws an InvalidOperationException if the XmlSerializer object is initialized with a type parameter that contains an array of objects of type XElement.

Silverlight

Supported in: 5, 4, 3

For a list of the operating systems and browsers that are supported by Silverlight, see Supported Operating Systems and Browsers.

Community Additions

ADD
Show:
© 2014 Microsoft