<remove> Element for <configSections>

Removes a predefined section or section group.


<remove name="section name or section group name" />

Required Attributes

Attribute Description
name Specifies the name of the section or section group to remove.


You can use the <remove> element to remove sections and section groups 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 a section previously defined in the machine configuration file.

The following machine configuration file code declares the section <sampleSection>.

<!-- Machine.config file. -->
      <section name="sampleSection"
               type="System.Configuration.SingleTagSectionHandler" />
   <sampleSection setting1="Value1" setting2="value two" 
                  setting3="third value" />

The following application configuration file code removes the <sampleSection> section. After removal, the application cannot retrieve the settings in <sampleSection>.

<!-- Application configuration file. -->
      <remove name="sampleSection"/>

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