ConfigurationElement.SerializeToXmlElement Method

Note: This method is new in the .NET Framework version 2.0.

Writes the outer tags of this configuration element to the configuration file when implemented in a derived class.

Namespace: System.Configuration
Assembly: System.Configuration (in system.configuration.dll)

protected internal virtual bool SerializeToXmlElement (
	XmlWriter writer,
	string elementName
protected boolean SerializeToXmlElement (
	XmlWriter writer, 
	String elementName
protected internal function SerializeToXmlElement (
	writer : XmlWriter, 
	elementName : String
) : boolean



The XmlWriter that writes to the configuration file.


The name of the ConfigurationElement to be written.

Return Value

true if writing was successful.

Exception typeCondition


The element has multiple child elements.

The SerializeToXmlElement method is called after the call to the Unmerge method during serialization. The SerializeToXmlElement method writes out the contents of the configuration element between the beginning and ending tags of the element. Override SerializeToXmlElement to provide a custom serialization method.

Windows 98, Windows 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 .NET Framework does not support all versions of every platform. For a list of the supported versions, see System Requirements.

.NET Framework

Supported in: 2.0