Share via


configSections 요소(일반 설정 스키마)

구성 섹션 및 네임스페이스 선언을 지정합니다.

   <configSections>
      <section />
      <sectionGroup />
      <remove />
      <clear/>
   </configSections>

특성 및 요소

다음 단원에서는 특성, 자식 요소 및 부모 요소에 대해 설명합니다.

특성

없음

자식 요소

요소

설명

clear

현재 sectionsectionGroup 요소에 추가된 섹션과 섹션 그룹만 허용하고 상속된 섹션과 섹션 그룹에 대한 모든 참조를 제거합니다.

remove

상속된 섹션과 섹션 그룹에 대한 참조를 제거합니다.

section

구성 섹션 처리기와 구성 요소 간의 연결을 정의합니다.

sectionGroup

구성 섹션 처리기와 구성 섹션 간의 연결을 정의합니다.

부모 요소

요소

설명

configuration

공용 언어 런타임 및 .NET Framework 응용 프로그램에서 사용하는 모든 구성 파일의 필수 루트 요소를 지정합니다.

설명

configSections 요소는 구성 섹션 및 처리기 선언을 지정합니다. ASP.NET에서는 구성 파일의 설정을 처리하는 방법에 대해 특정한 가정을 하지 않으므로 이 작업이 필요합니다. 대신 ASP.NET에서는 구성 데이터 처리를 구성 섹션 처리기에 위임합니다.

각 section 요소는 구성 섹션이나 요소 및 이러한 구성 섹션이나 요소를 처리하는 관련된 ConfigurationSection 파생 클래스를 식별합니다. section 요소를 sectionGroup 요소로 논리적으로 그룹화하여 section 요소를 구성하고 이름 충돌 문제를 방지할 수 있습니다. section 요소와 sectionGroup 요소는 configSections 요소에 포함되어 있습니다.

configSections 요소를 구성 파일에 사용하는 경우에는 configSections 요소가 configuration 요소의 첫 번째 자식 요소여야 합니다.

기본 구성

.NET 구성 요소에 대한 구성 섹션은 Machine.config 파일에 정의되어 있으며 너무 많아서 여기에 모두 나열할 수 없습니다. Machine.config 파일에서 발췌한 다음 예제에서는 system.web 섹션의 authentication 요소에 대한 구성 섹션 처리기를 정의합니다. 그 다음에는 authentication 요소에 대해 구성 설정을 정의합니다.

구성 섹션 처리기가 구성 요소와 연결되어 있지 않으면 ASP.NET에서 "인식할 수 없는 구성 섹션 element_name입니다."라는 서버 오류 메시지가 나타납니다.

<configuration>
    <configSections>
        <sectionGroup name="system.web" type="System.Web.Configuration.SystemWebSectionGroup, System.Web, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%">
            <section name="authentication" type="System.Web.Configuration.AuthenticationSection, System.Web, Version=2.0.3600.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" allowDefinition="MachineToApplication" />
            <!-- Other system.web sections -->
        </sectionGroup>
        <!-- Other configuration sections -->
    </configSections>

    <system.web>
        <authentication mode="Windows">
            <forms name=".ASPXAUTH" 
                   loginUrl="login.aspx" defaultUrl="default.aspx" 
                   protection="All" 
                   timeout="30" 
                   path="/" 
                   requireSSL="False" 
                   slidingExpiration="True" 
                   cookieless="UseCookies" 
                   domain="" 
                   enableCrossAppRedirects="False">
                <credentials passwordFormat="SHA1" />
            </forms>
            <passport redirectUrl="internal" />
        </authentication>
        <!-- Other system.web elements -->
    </system.web>
    <!-- Other configuration settings -->
</configuration>

예제

다음 코드 예제에서는 사용자 지정 구성 섹션 및 해당 섹션의 설정을 정의하는 방법을 보여 줍니다.

<configuration>

   <configSections>
      <section name="sampleSection"
               type="System.Configuration.SingleTagSectionHandler" />
   </configSections>

   <sampleSection setting1="Value1" 
                  setting2="value two" 
                  setting3="third value" />

</configuration>

요소 정보

구성 섹션 처리기

해당 없음

구성 멤버

ConfigurationSectionCollection

ConfigurationSectionGroupCollection

구성 가능한 위치

Machine.config

루트 수준의 Web.config

응용 프로그램 수준의 Web.config

가상 또는 실제 디렉터리 수준의 Web.config

요구 사항

Microsoft IIS(인터넷 정보 서비스) 버전 5.0, 5.1 또는 6.0

.NET Framework 버전 1.0, 1.1 또는 2.0

Microsoft Visual Studio 2003 또는 Visual Studio 2005

참고 항목

참조

configuration 요소(일반 설정 스키마)

configSections에 대한 section 요소(일반 설정 스키마)

configSections에 대한 sectionGroup 요소(일반 설정 스키마)

configSections에 대한 clear 요소(일반 설정 스키마)

configSections에 대한 remove 요소(일반 설정 스키마)

개념

ASP.NET 구성 파일 계층 구조 및 상속

ASP.NET 구성 파일 편집

ASP.NET 구성 시나리오

기타 리소스

일반 구성 설정(ASP.NET)

ASP.NET 구성 설정

ASP.NET 구성 파일

ASP.NET 웹 사이트 관리

ASP.NET 구성 API