<編譯器 > 項目<compilers> Element

編譯器組態項目的容器;內含零或多個 <compiler> 項目。Container for compiler configuration elements; contains zero or more <compiler> elements.

<configuration><configuration>
<system.codedom><system.codedom>
<編譯器 > 項目<compilers> Element

語法Syntax

<compilers>  
  <compiler ... />  
</compilers>  

屬性和項目Attributes and Elements

下列各節描述屬性、子項目和父項目。The following sections describe attributes, child elements, and parent elements.

屬性Attributes

無。None.

子元素Child Elements

項目Element 描述Description
<編譯器> 項目<compiler> Element 指定語言提供者的編譯器組態屬性。Specifies the compiler configuration attributes for a language provider.

父項目Parent Elements

項目Element 描述Description
<configuration> 項目<configuration> Element 通用語言執行平台和 .NET Framework 應用程式所使用之每個組態檔中的根項目。The root element in every configuration file used by the common language runtime and .NET Framework applications.
<system.codedom > 項目<system.codedom> Element 指定可用語言提供者的編譯器組態設定。Specifies compiler configuration settings for available language providers.

備註Remarks

<編譯器 >項目包含的電腦上的語言提供者的編譯器組態設定。The <compilers> element contains the compiler configuration settings for language providers on a computer. 每個<編譯器 >項目會指定特定的語言提供者的編譯器組態屬性。Each <compiler> element specifies the compiler configuration attributes for a specific language provider.

.NET Framework 會定義初始編譯器和語言提供者設定電腦組態檔 (Machine.config) 中。The .NET Framework defines the initial compiler and language provider settings in the machine configuration file (Machine.config). 開發人員和編譯器廠商可以為新的 System.CodeDom.Compiler.CodeDomProvider 實作新增組態設定。Developers and compiler vendors can add configuration settings for a new System.CodeDom.Compiler.CodeDomProvider implementation. 使用 CodeDomProvider.GetAllCompilerInfo 方法,以程式設計方式列舉電腦上的語言提供者和編譯器組態設定。Use the CodeDomProvider.GetAllCompilerInfo method to programmatically enumerate language provider and compiler configuration settings on a computer.

組態檔Configuration File

這個項目可以用於電腦組態檔和應用程式組態檔。This element can be used in the machine configuration file and the application configuration file.

範例Example

下列範例說明典型的編譯器組態項目。The following example illustrates a typical compiler configuration element.

<configuration>  
   <system.codedom>  
     <compilers>  
       <!-- zero or more compiler elements -->  
       <compiler   
          language="c#;cs;csharp"   
          extension=".cs"  
          type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"  
          compilerOptions=""    
          warningLevel="1" />  
     </compilers>  
   </system.codedom>  
</configuration>  

另請參閱See also