CompilationSection 클래스

정의

웹 애플리케이션의 컴파일 인프라를 지원하는 데 사용되는 구성 설정을 정의합니다. 이 클래스는 상속될 수 없습니다.

public ref class CompilationSection sealed : System::Configuration::ConfigurationSection
public sealed class CompilationSection : System.Configuration.ConfigurationSection
type CompilationSection = class
    inherit ConfigurationSection
Public NotInheritable Class CompilationSection
Inherits ConfigurationSection
상속

예제

이 예제에서는 값의 몇 가지 특성에 대해 선언적으로 지정 하는 방법에 설명 합니다 compilation 의 구성원으로도 액세스할 수 있는 섹션은 CompilationSection 클래스.

다음 구성 파일 예제에서는 값을 선언적으로 지정 하는 방법을 보여 줍니다는 compilation 섹션입니다.

<system.web>  
  <compilation   
    tempDirectory=""   
    debug="False"   
    strict="False"   
    explicit="True"   
    batch="True"   
    batchTimeout="900"   
    maxBatchSize="1000"   
    maxBatchGeneratedFileSize="1000"   
    numRecompilesBeforeAppRestart="15"   
    defaultLanguage="vb"   
    targetFramework="4.0"   
    urlLinePragmas="False"   
    assemblyPostProcessorType="">  
    <assemblies>  
      <clear />  
    </assemblies>  
    <buildProviders>  
      <clear />  
    </buildProviders>  
    <expressionBuilders>  
      <clear />  
    </expressionBuilders>  
  </compilation>   
</system.web>  

다음 코드 예제에서는 멤버를 사용 하는 방법에 설명 합니다 CompilationSection 클래스입니다.

#region Using directives

using System;
using System.Collections.Generic;
using System.Text;
using System.Configuration;
using System.Web;
using System.Web.Configuration;

#endregion

namespace Samples.Aspnet.SystemWebConfiguration
{
  class UsingCompilationSection
  {
    static void Main(string[] args)
    {
      try
      {
        // Set the path of the config file.
        string configPath = "";

        // Get the Web application configuration object.
        Configuration config = WebConfigurationManager.OpenWebConfiguration(configPath);

        // Get the section related object.
        CompilationSection configSection =
          (CompilationSection)config.GetSection("system.web/compilation");

        // Display title and info.
        Console.WriteLine("ASP.NET Configuration Info");
        Console.WriteLine();

        // Display Config details.
        Console.WriteLine("File Path: {0}",
          config.FilePath);
        Console.WriteLine("Section Path: {0}",
          configSection.SectionInformation.Name);

        // Display Assemblies collection count.
        Console.WriteLine("Assemblies Count: {0}",
          configSection.Assemblies.Count);

        // Display AssemblyPostProcessorType property.
        Console.WriteLine("AssemblyPostProcessorType: {0}", 
          configSection.AssemblyPostProcessorType);

        // Display Batch property.
        Console.WriteLine("Batch: {0}", configSection.Batch);

        // Set Batch property.
        configSection.Batch = true;

        // Display BatchTimeout property.
        Console.WriteLine("BatchTimeout: {0}",
          configSection.BatchTimeout);

        // Set BatchTimeout property.
        configSection.BatchTimeout = TimeSpan.FromMinutes(15);

          // Display BuildProviders collection count.
          Console.WriteLine("BuildProviders collection Count: {0}",
          configSection.BuildProviders.Count);

          // Display CodeSubDirectories collection count.
          Console.WriteLine("CodeSubDirectories Count: {0}",
        configSection.CodeSubDirectories.Count);

        // Display Compilers collection count.
        Console.WriteLine("Compilers Count: {0}",
        configSection.Compilers.Count);

        // Display Debug property.
        Console.WriteLine("Debug: {0}",
          configSection.Debug);

        // Set Debug property.
        configSection.Debug = false;

        // Display DefaultLanguage property.
        Console.WriteLine("DefaultLanguage: {0}",
          configSection.DefaultLanguage);

        // Set DefaultLanguage property.
        configSection.DefaultLanguage = "vb";

        // Display Explicit property.
        Console.WriteLine("Explicit: {0}",
          configSection.Explicit);

        // Set Explicit property.
        configSection.Explicit = true;

        // Display ExpressionBuilders collection count.
        Console.WriteLine("ExpressionBuilders Count: {0}",
          configSection.ExpressionBuilders.Count);

        // Display MaxBatchGeneratedFileSize property.
        Console.WriteLine("MaxBatchGeneratedFileSize: {0}", 
          configSection.MaxBatchGeneratedFileSize);

        // Set MaxBatchGeneratedFileSize property.
        configSection.MaxBatchGeneratedFileSize = 1000;

        // Display MaxBatchSize property.
        Console.WriteLine("MaxBatchSize: {0}", 
          configSection.MaxBatchSize);

        // Set MaxBatchSize property.
        configSection.MaxBatchSize = 1000;

        // Display NumRecompilesBeforeAppRestart property.
        Console.WriteLine("NumRecompilesBeforeAppRestart: {0}", 
          configSection.NumRecompilesBeforeAppRestart);

        // Set NumRecompilesBeforeAppRestart property.
        configSection.NumRecompilesBeforeAppRestart = 15;

        // Display Strict property.
        Console.WriteLine("Strict: {0}", 
          configSection.Strict);

        // Set Strict property.
        configSection.Strict = false;

        // Display TempDirectory property.
        Console.WriteLine("TempDirectory: {0}", configSection.TempDirectory);

        // Set TempDirectory property.
        configSection.TempDirectory = "myTempDirectory";

        // Display UrlLinePragmas property.
        Console.WriteLine("UrlLinePragmas: {0}", 
          configSection.UrlLinePragmas);

        // Set UrlLinePragmas property.
        configSection.UrlLinePragmas = false;

        // ExpressionBuilders Collection
        int i = 1;
        int j = 1;
        foreach (ExpressionBuilder expressionBuilder in configSection.ExpressionBuilders)
        {
          Console.WriteLine();
          Console.WriteLine("ExpressionBuilder {0} Details:", i);
          Console.WriteLine("Type: {0}", expressionBuilder.ElementInformation.Type);
          Console.WriteLine("Source: {0}", expressionBuilder.ElementInformation.Source);
          Console.WriteLine("LineNumber: {0}", expressionBuilder.ElementInformation.LineNumber);
          Console.WriteLine("Properties Count: {0}", expressionBuilder.ElementInformation.Properties.Count);
          j = 1;
          foreach (PropertyInformation propertyItem in expressionBuilder.ElementInformation.Properties)
          {
            Console.WriteLine("Property {0} Name: {1}", j, propertyItem.Name);
            Console.WriteLine("Property {0} Value: {1}", j, propertyItem.Value);
            j++;
          }
          i++;
        }

        // Update if not locked.
        if (!configSection.SectionInformation.IsLocked)
        {
          config.Save();
          Console.WriteLine("** Configuration updated.");
        }
        else
        {
          Console.WriteLine("** Could not update, section is locked.");
        }
      }

      catch (Exception e)
      {
        // Unknown error.
        Console.WriteLine(e.ToString());
      }

      // Display and wait
      Console.ReadLine();
    }
  }
}
Imports System.Collections.Generic
Imports System.Text
Imports System.Configuration
Imports System.Web
Imports System.Web.Configuration

Namespace Samples.Aspnet.SystemWebConfiguration
  Class UsingRoleManagerSection
    Public Shared Sub Main()
      Try
        ' Set the path of the config file.
        Dim configPath As String = ""

        ' Get the Web application configuration object.
        Dim config As System.Configuration.Configuration = _
         WebConfigurationManager.OpenWebConfiguration(configPath)

        ' Get the section related object.
        Dim configSection As System.Web.Configuration.CompilationSection = _
         CType(config.GetSection("system.web/compilation"), _
         System.Web.Configuration.CompilationSection)

        ' Display title and info.
        Console.WriteLine("ASP.NET Configuration Info")
        Console.WriteLine()

        ' Display Config details.
        Console.WriteLine("File Path: {0}", _
         config.FilePath)
        Console.WriteLine("Section Path: {0}", _
         configSection.SectionInformation.Name)

        ' Display Assemblies collection count.
        Console.WriteLine("Assemblies Count: {0}", _
         configSection.Assemblies.Count)

        ' Display AssemblyPostProcessorType property.
        Console.WriteLine("AssemblyPostProcessorType: {0}", _
         configSection.AssemblyPostProcessorType)

        ' Display Batch property.
        Console.WriteLine("Batch: {0}", _
         configSection.Batch)

        ' Set Batch property.
        configSection.Batch = True

        ' Display BatchTimeout property.
        Console.WriteLine("BatchTimeout: {0}", _
         configSection.BatchTimeout)

        ' Set BatchTimeout property.
        configSection.BatchTimeout = TimeSpan.FromMinutes(15)

        ' Display BuildProviders collection count.
        Console.WriteLine("BuildProviders collection count: {0}", _
         configSection.BuildProviders.Count)

        ' Display CodeSubDirectories property.
        Console.WriteLine("CodeSubDirectories: {0}", _
         configSection.CodeSubDirectories.Count)

        ' Display Compilers property.
        Console.WriteLine("Compilers: {0}", _
         configSection.Compilers.Count)

        ' Display Debug property.
        Console.WriteLine("Debug: {0}", _
         configSection.Debug)

        ' Set Debug property.
        configSection.Debug = False


        ' Display DefaultLanguage property.
        Console.WriteLine("DefaultLanguage: {0}", _
         configSection.DefaultLanguage)

        ' Set DefaultLanguage property.
        configSection.DefaultLanguage = "vb"

        ' Display Explicit property.
        Console.WriteLine("Explicit: {0}", _
         configSection.Explicit)

        ' Set Explicit property.
        configSection.Explicit = True

        ' Display ExpressionBuilders collection count.
        Console.WriteLine("ExpressionBuilders Count: {0}", _
         configSection.ExpressionBuilders.Count)

        ' Display MaxBatchGeneratedFileSize property.
        Console.WriteLine("MaxBatchGeneratedFileSize: {0}", _
         configSection.MaxBatchGeneratedFileSize)

        ' Set MaxBatchGeneratedFileSize property.
        configSection.MaxBatchGeneratedFileSize = 1000

        ' Display MaxBatchSize property.
        Console.WriteLine("MaxBatchSize: {0}", _
         configSection.MaxBatchSize)

        ' Set MaxBatchSize property.
        configSection.MaxBatchSize = 1000

        ' Display NumRecompilesBeforeAppRestart property.
        Console.WriteLine("NumRecompilesBeforeAppRestart: {0}", _
         configSection.NumRecompilesBeforeAppRestart)

        ' Set NumRecompilesBeforeAppRestart property.
        configSection.NumRecompilesBeforeAppRestart = 15

        ' Display Strict property.
        Console.WriteLine("Strict: {0}", _
         configSection.Strict)

        ' Set Strict property.
        configSection.Strict = False

        ' Display TempDirectory property.
        Console.WriteLine("TempDirectory: {0}", _
         configSection.TempDirectory)

        ' Set TempDirectory property.
        configSection.TempDirectory = "myTempDirectory"

        ' Display UrlLinePragmas property.
        Console.WriteLine("UrlLinePragmas: {0}", _
         configSection.UrlLinePragmas)

        ' Set UrlLinePragmas property.
        configSection.UrlLinePragmas = False

        ' ExpressionBuilders Collection
        Dim i = 1
        Dim j = 1
        For Each expressionBuilder As ExpressionBuilder In configSection.ExpressionBuilders()
          Console.WriteLine()
          Console.WriteLine("ExpressionBuilder {0} Details:", i)
          Console.WriteLine("Type: {0}", expressionBuilder.ElementInformation.Type)
          Console.WriteLine("Source: {0}", expressionBuilder.ElementInformation.Source)
          Console.WriteLine("LineNumber: {0}", expressionBuilder.ElementInformation.LineNumber)
          Console.WriteLine("Properties Count: {0}", expressionBuilder.ElementInformation.Properties.Count)
          j = 1
          For Each propertyItem As PropertyInformation In expressionBuilder.ElementInformation.Properties
            Console.WriteLine("Property {0} Name: {1}", j, propertyItem.Name)
            Console.WriteLine("Property {0} Value: {1}", j, propertyItem.Value)
            j = j + 1
          Next
          i = i + 1
        Next

        ' Update if not locked.
        If Not configSection.SectionInformation.IsLocked Then
          config.Save()
          Console.WriteLine("** Configuration updated.")
        Else
          Console.WriteLine("** Could not update, section is locked.")
        End If

      Catch e As Exception
        ' Unknown error.
        Console.WriteLine(e.ToString())
      End Try

      ' Display and wait
      Console.ReadLine()
    End Sub
  End Class
End Namespace

설명

합니다 CompilationSection 클래스는 프로그래밍 방식으로 액세스 하 고 내용을 수정 하는 방법을 제공 합니다 compilation 구성 파일의 섹션입니다.

생성자

CompilationSection()

기본 설정을 사용하여 CompilationSection 클래스의 새 인스턴스를 초기화합니다.

속성

Assemblies

AssemblyCollectionCompilationSection을 가져옵니다.

AssemblyPostProcessorType

어셈블리의 후처리 컴파일 단계를 지정하는 값을 가져오거나 설정합니다.

Batch

일괄 컴파일을 시도할지 여부를 나타내는 값을 가져오거나 설정합니다.

BatchTimeout

일괄 컴파일의 제한 시간(초)을 가져오거나 설정합니다.

BuildProviders

CompilationSection 클래스의 BuildProviderCollection 컬렉션을 가져옵니다.

CodeSubDirectories

CodeSubDirectoriesCollectionCompilationSection을 가져옵니다.

Compilers

CompilationSection 클래스의 CompilerCollection 컬렉션을 가져옵니다.

ControlBuilderInterceptorType

ControlBuilder 개체를 가로채고 컨테이너를 구성하기 위해 사용되는 개체 형식을 나타내는 문자열을 가져오거나 설정합니다.

CurrentConfiguration

현재 Configuration 인스턴스가 속해 있는 구성 계층 구조를 나타내는 최상위 ConfigurationElement 인스턴스에 대한 참조를 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
Debug

릴리스 이진 파일을 컴파일할지 디버그 이진 파일을 컴파일할지 지정하는 값을 가져오거나 설정합니다.

DefaultLanguage

동적 컴파일 파일에 사용할 기본 프로그래밍 언어를 가져오거나 설정합니다.

DisableObsoleteWarnings

컴파일 섹션에서 "disableObsoleteWarnings" 구성 값을 설정할지 여부를 가져오거나 설정합니다.

ElementInformation

ElementInformation 개체의 사용자 지정할 수 없는 정보와 기능을 포함하는 ConfigurationElement 개체를 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
ElementProperty

ConfigurationElementProperty 개체 자체를 나타내는 ConfigurationElement 개체를 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
EnablePrefetchOptimization

ASP.NET 애플리케이션이 Windows 8 프리페치 기능을 활용할 수 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

EvaluationContext

ContextInformation 개체의 ConfigurationElement 개체를 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
Explicit

Microsoft Visual Basic explicit 컴파일 옵션을 사용할지 여부를 나타내는 값을 가져오거나 설정합니다.

ExpressionBuilders

ExpressionBuilderCollectionCompilationSection을 가져옵니다.

FolderLevelBuildProviders

컴파일하는 동안 사용되는 빌드 공급자를 나타내는 FolderLevelBuildProviderCollection 클래스의 CompilationSection 컬렉션을 가져옵니다.

HasContext

CurrentConfiguration 속성이 null인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
Item[ConfigurationProperty]

이 구성 요소의 속성이나 특성을 가져오거나 설정합니다.

(다음에서 상속됨 ConfigurationElement)
Item[String]

이 구성 요소의 속성, 특성 또는 자식 요소를 가져오거나 설정합니다.

(다음에서 상속됨 ConfigurationElement)
LockAllAttributesExcept

잠긴 특성의 컬렉션을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
LockAllElementsExcept

잠긴 요소의 컬렉션을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
LockAttributes

잠긴 특성의 컬렉션을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
LockElements

잠긴 요소의 컬렉션을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
LockItem

요소가 잠겨 있는지 여부를 나타내는 값을 가져오거나 설정합니다.

(다음에서 상속됨 ConfigurationElement)
MaxBatchGeneratedFileSize

일괄 컴파일 작업당 생성되는 전체 소스 파일의 최대 크기를 가져오거나 설정합니다.

MaxBatchSize

일괄 컴파일 작업당 최대 페이지 수를 가져오거나 설정합니다.

MaxConcurrentCompilations

컴파일 섹션에서 "maxConcurrentCompilations" 구성 값을 설정할지 여부를 가져오거나 설정합니다.

NumRecompilesBeforeAppRestart

애플리케이션을 다시 시작하기 전에 리소스를 동적으로 다시 컴파일할 수 있는 횟수를 가져오거나 설정합니다.

OptimizeCompilations

컴파일을 최적화해야 하는지 여부를 나타내는 값을 가져오거나 설정합니다.

ProfileGuidedOptimizations

애플리케이션이 배포된 환경에 대해 최적화되었는지 여부를 나타내는 값을 가져오거나 설정합니다.

Properties

속성 컬렉션을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
SectionInformation

사용자가 지정할 수 없는 SectionInformation 개체의 정보와 기능을 포함하는 ConfigurationSection 개체를 가져옵니다.

(다음에서 상속됨 ConfigurationSection)
Strict

Visual Basic strict 컴파일 옵션을 가져오거나 설정합니다.

TargetFramework

웹 사이트의 대상이 되는 .NET Framework 버전을 가져오거나 설정합니다.

TempDirectory

컴파일할 때 임시 파일 스토리지로 사용할 디렉터리를 지정하는 값을 가져오거나 설정합니다.

UrlLinePragmas

컴파일러 지시 사항에 실제 경로와 URL 중 어느 것을 사용할지 나타내는 값을 가져오거나 설정합니다.

메서드

DeserializeElement(XmlReader, Boolean)

구성 파일에서 XML을 읽습니다.

(다음에서 상속됨 ConfigurationElement)
DeserializeSection(XmlReader)

구성 파일에서 XML을 읽습니다.

(다음에서 상속됨 ConfigurationSection)
Equals(Object)

현재 ConfigurationElement 인스턴스를 지정된 개체와 비교합니다.

(다음에서 상속됨 ConfigurationElement)
GetHashCode()

현재 ConfigurationElement 인스턴스를 나타내는 고유 값을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
GetRuntimeObject()

파생 클래스에서 재정의될 때 사용자 지정 개체를 반환합니다.

(다음에서 상속됨 ConfigurationSection)
GetTransformedAssemblyString(String)

지정된 어셈블리 이름의 변환된 버전을 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetTransformedTypeString(String)

지정된 형식 이름의 변환된 버전을 반환합니다.

(다음에서 상속됨 ConfigurationElement)
GetType()

현재 인스턴스의 Type을 가져옵니다.

(다음에서 상속됨 Object)
Init()

ConfigurationElement 개체를 초기 상태로 설정합니다.

(다음에서 상속됨 ConfigurationElement)
InitializeDefault()

ConfigurationElement 개체 값의 기본 집합을 초기화하는 데 사용됩니다.

(다음에서 상속됨 ConfigurationElement)
IsModified()

이 구성 요소가 파생 클래스에서 구현되었을 때 마지막으로 저장되거나 로드된 이후 수정되었는지 여부를 나타냅니다.

(다음에서 상속됨 ConfigurationSection)
IsReadOnly()

ConfigurationElement 개체가 읽기 전용인지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
ListErrors(IList)

ConfigurationElement 개체와 모든 하위 요소의 잘못된 속성 오류를 전달된 목록에 추가합니다.

(다음에서 상속됨 ConfigurationElement)
MemberwiseClone()

현재 Object의 단순 복사본을 만듭니다.

(다음에서 상속됨 Object)
OnDeserializeUnrecognizedAttribute(String, String)

역직렬화하는 동안 알 수 없는 특성을 발견했는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
OnDeserializeUnrecognizedElement(String, XmlReader)

역직렬화하는 동안 알 수 없는 요소를 발견했는지 여부를 나타내는 값을 가져옵니다.

(다음에서 상속됨 ConfigurationElement)
OnRequiredPropertyNotFound(String)

필수 속성이 없으면 예외를 throw합니다.

(다음에서 상속됨 ConfigurationElement)
PostDeserialize()

deserialization 후에 호출됩니다.

(다음에서 상속됨 ConfigurationElement)
PreSerialize(XmlWriter)

serialization 전에 호출됩니다.

(다음에서 상속됨 ConfigurationElement)
Reset(ConfigurationElement)

잠금 및 속성 컬렉션을 비롯하여 ConfigurationElement 개체의 내부 상태를 다시 설정합니다.

(다음에서 상속됨 ConfigurationElement)
ResetModified()

파생 클래스에서 구현되는 경우 IsModified() 메서드의 값을 false로 다시 설정합니다.

(다음에서 상속됨 ConfigurationSection)
SerializeElement(XmlWriter, Boolean)

파생 클래스에서 구현될 때 구성 요소의 내용을 구성 파일에 씁니다.

(다음에서 상속됨 ConfigurationElement)
SerializeSection(ConfigurationElement, String, ConfigurationSaveMode)

ConfigurationSection 개체의 병합되지 않은 뷰가 들어 있는 XML 문자열을 파일에 쓸 단일 섹션으로 만듭니다.

(다음에서 상속됨 ConfigurationSection)
SerializeToXmlElement(XmlWriter, String)

파생 클래스에서 구현될 때 구성 요소의 외부 태그를 구성 파일에 씁니다.

(다음에서 상속됨 ConfigurationElement)
SetPropertyValue(ConfigurationProperty, Object, Boolean)

속성을 지정된 값으로 설정합니다.

(다음에서 상속됨 ConfigurationElement)
SetReadOnly()

IsReadOnly() 개체와 모든 하위 요소에 대한 ConfigurationElement 속성을 설정합니다.

(다음에서 상속됨 ConfigurationElement)
ShouldSerializeElementInTargetVersion(ConfigurationElement, String, FrameworkName)

구성 개체 계층이 .NET Framework 지정된 대상 버전에 대해 직렬화될 때 지정된 요소를 serialize해야 하는지 여부를 나타냅니다.

(다음에서 상속됨 ConfigurationSection)
ShouldSerializePropertyInTargetVersion(ConfigurationProperty, String, FrameworkName, ConfigurationElement)

구성 개체 계층이 .NET Framework 지정된 대상 버전에 대해 serialize될 때 지정된 속성을 serialize해야 하는지 여부를 나타냅니다.

(다음에서 상속됨 ConfigurationSection)
ShouldSerializeSectionInTargetVersion(FrameworkName)

구성 개체 계층 구조가 지정된 대상 버전의 .NET Framework 직렬화될 때 현재 ConfigurationSection 인스턴스를 serialize해야 하는지 여부를 나타냅니다.

(다음에서 상속됨 ConfigurationSection)
ToString()

현재 개체를 나타내는 문자열을 반환합니다.

(다음에서 상속됨 Object)
Unmerge(ConfigurationElement, ConfigurationElement, ConfigurationSaveMode)

ConfigurationElement 개체를 수정하여 저장되지 않아야 하는 값을 모두 제거합니다.

(다음에서 상속됨 ConfigurationElement)

적용 대상

추가 정보