服务器配置文件信息:machine.config,安装net Framework自动生成的,是服务器上运行的所有web应用程序的默认设置。
每一个web应用程序都有一个独立的配置文件,将machine.config中的某些属性进行个性化设置,这个文件为web.config,可以在任何目录下。
web.config文件所做的设置会覆盖machine.config文件中的设置,并且在当前目录及子目录下起作用。一个解决方案可以有多个web.config。
<configuration>
<configSections>
<section name="[sectionSettings]" type="[Class]" />
<sectionGroup name="[sectionGroup]">
<section name="[sectionSettings]" type="[Class]" />
</sectionGroup>
</configSections>
</configuration>
所有配置位于<configuration></configuration>之间。
section称为配置节,是配置设置的基本单位,每一个配置节在使用之前必须在<configSections></configSections>之中定义。
定义的方式为<section name="[sectionSettings]" type="[Class]"/>,
section 也可以定义在某个sectionGroup中。
定义了section之后,就可以在<configuration>的根下定义这个section的属性配置了。