Export (0) Print
Expand All
This topic has not yet been rated - Rate this topic

compilers Element for compilation (ASP.NET Settings Schema)

Specifies the compilers that the ASP.NET application supports.

NoteNote

In the .NET Framework version 2.0, this element is deprecated in favor of the compilers element of the system.codeDom section. However, using the compilers child element of the compilation element is still valid and overrides the compilers element that is located in the system.codedom section.


<compilers> 
   <compiler language="language"
             extension="ext"
             type=".NET Type" 
             warningLevel="number"  
             compilerOptions="options"/>
</compilers>

The following sections describe attributes, child elements, and parent elements.

Attributes

None.

Child Elements

Subtag Description

compiler

Defines a new compiler option.

Any number of compiler tags can be used in the compiler section.

Parent Elements

Element Description

configuration

Specifies the required root element in every configuration file that is used by the common language runtime and the .NET Framework applications.

system.web

Specifies the root element for the ASP.NET configuration settings in a configuration file and contains configuration elements that configure ASP.NET Web applications and control how the applications behave.

compilation

Configures all compilation settings that ASP.NET uses to compile applications.

The compilers element specifies the compilers that the ASP.NET application supports.

In the .NET Framework version 2.0, this element is deprecated in favor of the compilers element of the system.codeDom section. However, using the compilers child element of the compilation element is still valid and overrides the compilers element that is located in the system.codedom section.

By default, the compilers element is not configured in the .NET Framework version 2.0 because the compilers element has been deprecated. However, there is a default compilers element that is defined in the system.codeDom section. The compilers element is not explicitly configured in the Machine.configuration file or in the root Web.config file. However, it is the default configuration that is returned by the application.

<system.codedom>
   <compilers>
       <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%ECMA_PUBLICKEY%" warningLevel="1" />
       <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%ECMA_PUBLICKEY%" />
       <compiler language="js;jscript;javascript" extension=".js" type="Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript, Version=8.0.1100.0, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%" />
       <compiler language="vj#;vjs;vjsharp" extension=".jsl" type="Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider, Version=%ASSEMBLY_VERSION%, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%" />
       <compiler language="c++;mc;cpp" extension=".h" type="Microsoft.VisualC.CppCodeProvider, CppCodeProvider, Version=8.0.0.0, Culture=neutral, PublicKeyToken=%MICROSOFT_PUBLICKEY%" />
   </compilers>
</system.codedom>

The following default compilers element is configured in the Machine.config file for the .NET Framework version 1.1.

<compilers>
   <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="1"/>
   <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.5000.0, Culture=neutral, PublicKeyToken=b77a5c561934e089"/>
   <compiler language="js;jscript;javascript" extension=".js" type="Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
   <compiler language="VJ#;VJS;VJSharp" extension=".jsl" type="Microsoft.VJSharp.VJSharpCodeProvider, VJSharpCodeProvider, Version=7.0.5000.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a"/>
</compilers>

The following default compilers element is configured in the Machine.config file for the .NET Framework version 1.0.

<compilers>
    <compiler language="c#;cs;csharp" extension=".cs" type="Microsoft.CSharp.CSharpCodeProvider, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" warningLevel="1" />
    <compiler language="vb;vbs;visualbasic;vbscript" extension=".vb" type="Microsoft.VisualBasic.VBCodeProvider, System, Version=1.0.3300.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" />
    <compiler language="js;jscript;javascript" extension=".js" type="Microsoft.JScript.JScriptCodeProvider, Microsoft.JScript, Version=7.0.3300.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a" />
</compilers>

The following code example demonstrates how to configure compilation settings for an application.

<compilation defaultLanguage="VB"
    debug="true"
    numRecompilesBeforeAppRestart="15">
    
    <compilers>
       <compiler language="VB;VBScript"
          extension=".cls"
          type="Microsoft.VisualBasic.VBCodeProvider,system,     
           Version=1.0.5000.0, Culture=neutral, 
           PublicKeyToken=b77a5c561934e089"/>
       <compiler language="C#;Csharp"
          extension=".cs" 
          type="Microsoft.CSharp.CSharpCodeProvider,system, 
           Version=1.0.5000.0,  Culture=neutral, 
           PublicKeyToken=b77a5c561934e089"/>
    </compilers>

    <assemblies>
       <add assembly="ADODB"/>
       <add assembly="*"/>
    </assemblies>

      </compilation>

Configuration section handler

CompilationSection

Configuration member

Compilers

CompilerCollection

Configurable locations

Machine.config

Root-level Web.config

Application-level Web.config

Virtual or physical directory–level Web.config

Requirements

Microsoft Internet Information Services (IIS) version 5.0, 5.1, or 6.0

The .NET Framework version 1.0, 1.1, or 2.0

Microsoft Visual Studio 2003 or Visual Studio 2005

Did you find this helpful?
(1500 characters remaining)
Thank you for your feedback

Community Additions

ADD
Show:
© 2014 Microsoft. All rights reserved.