<sectionGroup> element for <configSections>
Defines a namespace for configuration sections.
<configuration>
<configSections>
<sectionGroup>
Syntax
<sectionGroup name="section group name">
<!-- Configuration sections -->
</sectionGroup>
Attribute
Description | |
---|---|
name | Required attribute. Specifies the name of the section group you are defining. |
Parent element
Description | |
---|---|
<configSections> Element | Contains configuration section and namespace declarations. |
Child elements
Description | |
---|---|
<section> | Contains a configuration section declaration. |
Remarks
Declaring a section group creates a container tag for configuration sections and ensures that there are no naming conflicts with configuration sections defined by someone else. You can nest <sectionGroup> elements within each other.
Example
The following example shows how to declare a section group and declare sections within a section group:
<configuration>
<configSections>
<sectionGroup name="mySectionGroup">
<section name="mySection"
type="System.Configuration.NameValueSectionHandler,System" />
</sectionGroup>
</configSections>
<mySectionGroup>
<mySection>
<add key="key1" value="value1" />
</mySection>
</mySectionGroup>
</configuration>
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
Tehke meiega GitHubis koostööd
Selle sisu allika leiate GitHubist, kus saate ka probleeme luua ja läbi vaadata ning päringuid teha. Lisateavet leiate meie kaasautorite juhendist.