<remove> Element for NameValueSectionHandler and DictionarySectionHandler

<remove> Element for NameValueSectionHandler and DictionarySectionHandler

.NET Framework 1.1

Removes a previously defined setting.


<remove key="predefened setting key"/>

Required Attributes

Attribute Description
key Specifies the key name of the setting to remove.


You can use the <remove> element to remove settings from your application that were defined at a higher level in the configuration file hierarchy.


The following example shows how to use the <remove> element in an application configuration file to remove settings previously defined in the machine configuration file.

The following machine configuration file code declares the section <mySection> and adds two settings, key1 and key2, to it.

<!-- Machine.config file. -->
      <section name="mySection"
         type="System.Configuration.NameValueSectionHandler,System" />
      <add key="key1" value="value1" />
      <add key="key2" value="value2" />

The following application configuration file code removes the key2 setting from <mySection>.

<!--Application configuration file. -->
      <remove key="key2"/>

Configuration File

This element can be used in the application configuration file, machine configuration file (Machine.config), and Web.config files that are not at the application directory level.

See Also

Configuration Sections Schema | Configuration Section Settings

© 2015 Microsoft