SectionInformation.ConfigSource Property

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

Gets or sets the name of the include file in which the associated configuration section is defined, if such a file exists.

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

public string ConfigSource { get; set; 
/** @property */
public String get_ConfigSource ()

/** @property */
public void set_ConfigSource (String value)

public function get ConfigSource () : String

public function set ConfigSource (value : String)

Property Value

The name of the include file in which the associated ConfigurationSection is defined, if such a file exists; otherwise, an empty string.

The ConfigSource property represents the value of the configSource attribute specified for a ConfigurationSection object associated with the SectionInformation object.

A ConfigurationSection implementation can optionally specify a separate file in which the configuration settings for that section are defined. This can be useful in multiple ways:

  • Using include files can result in a more logical and modular structure to configuration files.

  • File access security and permissions can be used to restrict access to sections of configuration settings.

  • Settings in an include file that are not used during application initialization can be modified and reloaded without requiring a restart.

The following example shows how this attribute is used in a configuration file to specify that the pages section is defined in an external include file:

<pages configSource="pages.config"/>

If any of the settings in a configuration include file require an application restart when they are modified, set the RestartOnExternalChanges property to true.

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

Community Additions