This documentation is archived and is not being maintained.

ConfigurationManager::AppSettings Property

Gets the AppSettingsSection data for the current application's default configuration.

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

static property NameValueCollection^ AppSettings {
	NameValueCollection^ get ();

Property Value

Type: System.Collections.Specialized::NameValueCollection
Returns a NameValueCollection object that contains the contents of the AppSettingsSection object for the current application's default configuration.


Could not retrieve a NameValueCollection object with the application settings data.

A AppSettingsSection object contains the contents of the configuration file's appSettings section.

The following example shows how to use the AppSettings property. It is part of a larger example that is provided for the ConfigurationManager class.

No code example is currently available or this language may not be supported.

The example works with configuration elements that are similar to the ones illustrated in the following configuration file. These elements are generated the first time you run the example.

      <add key="NewKey0" value="Monday, March 30, 
           2009 1:36:33 PM" />
      <add key="NewKey1" value="Monday, March 30, 
           2009 1:36:40 PM" />

Windows 7, Windows Vista, Windows XP SP2, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP Starter Edition, Windows Server 2008 R2, Windows Server 2008, Windows Server 2003, Windows Server 2000 SP4, Windows Millennium Edition, Windows 98

The .NET Framework and .NET Compact Framework do not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.

.NET Framework

Supported in: 3.5, 3.0, 2.0