This documentation is archived and is not being maintained.

ConfigurationElement.DeserializeElement Method

Reads XML from the configuration file.

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

protected internal virtual void DeserializeElement (
	XmlReader reader,
	bool serializeCollectionKey
protected void DeserializeElement (
	XmlReader reader, 
	boolean serializeCollectionKey
protected internal function DeserializeElement (
	reader : XmlReader, 
	serializeCollectionKey : boolean
Not applicable.



The XmlReader that reads from the configuration file.


true to serialize only the collection key properties; otherwise, false.

Exception typeCondition


The element to read is locked.

- or -

An attribute of the current node is not recognized.

- or -

The lock status of the current node cannot be determined.

The following example demonstrates how to extend the DeserializeElement method.

protected override void DeserializeElement(
   System.Xml.XmlReader reader, 
    bool serializeCollectionKey)

    // Enter your custom processing code here.
    if (_displayIt)
           "UrlConfigElement.DeserializeElement({0}, {1}) called",
           (reader == null) ? "null" : reader.ToString(),

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