This documentation is archived and is not being maintained.

ConfigurationElement.SerializeToXmlElement Method

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
Not applicable.



The XmlWriter that writes to the configuration file.


The name of the ConfigurationElement to be written.

Return Value

true if writing was successful; otherwise, false.

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 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, 2.0