包含配置节和命名空间声明。
<configuration>
<configSections>
特性
None
Parent 元素
| Parent 元素 | Description |
|---|---|
<configuration> |
公共语言运行时和 .NET Framework 应用程序所使用的每个配置文件中的根元素。 |
子元素
| 子元素 | Description |
|---|---|
<section> |
包含配置节声明。 |
<sectionGroup> |
定义配置节的命名空间。 |
注解
如果此元素位于配置文件中,则它必须是元素的第一个子元素 <configuration> 。
Example
以下示例演示如何定义配置节并定义该部分的设置:
<configuration>
<configSections>
<section name="sampleSection"
type="System.Configuration.SingleTagSectionHandler" />
</configSections>
<sampleSection setting1="Value1"
setting2="value two"
setting3="third value" />
</configuration>
配置文件
此元素可用于应用程序配置文件、计算机配置文件(Machine.config)和不在应用程序目录级别的 Web.config 文件。