This documentation is archived and is not being maintained.

ElementInformation.LineNumber Property

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

Gets the line number in the configuration file where the associated ConfigurationElement object is defined.

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

public int LineNumber { get; 
/** @property */
public int get_LineNumber ()

public function get LineNumber () : int

Property Value

The line number in the configuration file where the associated ConfigurationElement object is defined.

The following code example shows how to use the LineNumber property.

protected override string SerializeSection(
    ConfigurationElement parentElement,
    string name, ConfigurationSaveMode saveMode)
{
    string s =
        base.SerializeSection(parentElement,
        name, saveMode);

    // Enter your custom processing code here.

    if (_displayIt)
    {
        Console.WriteLine(
           "UrlsSection.SerializeSection({0, {1, {2) called = {3",
           parentElement.ToString(), name,
           saveMode.ToString(), s);
    
    return s;


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
Show: