NGWS SDK Documentation  

This is preliminary documentation and subject to change.
To comment on this topic, please send us email at ngwssdk@microsoft.com. Thanks!

<compilation> Section Handler

Configures all compilation settings used by ASP+.

<compilation debugmode="true/false">

   <compilers defaultlanguage="[Lang]">
      <compiler 
         language="[Lang]" 
         extension="[ Ext]" 
         type="[Assembly]# [NGWS Class] "/>
   </compilers>

   <assemblies>
      <add assembly="[Assembly] " />
      <remove assembly="[Assembly]"  />
      <clear />
   </assemblies>

</compilation>

The <compilation> tag supports one attribute – debugmode – that indicates whether compilation should compile retail (False) or debug (True) binaries. The default is False.

The <compilers> subtag supports one attribute – defaultlanguage – that controls the default language used within .aspx, .asmx and .asax files when no languge is specified. It also supports one subelement, <compiler>, which creates a new compiler definition. The <compiler> element supports three attributes:

Subelement Attribute Description
<compiler>   Creates a new compiler definition.
  Language Indicates the language name used in dynamic compilation files. For example: “C#”, “PERL”, “Jscript”, “VB”, etc.
  Extension Filename extension used for dynamic code-behind files. Examples: .pl, .cls, .js
  Type Indicates the NGWS class (which implements Icompiler) that should be used to compile all resources that use either the above language or file extension.

The <assemblies> subtag supports three types of subelements that act as processing directives:

Subtag Directive Description
<assemblies>   Adds or removes assembly references that are to be used during the compilation of a dynamic resource.
  add Adds an assembly reference to be used during the compilation of a dynamic resource. ASP+ will automatically link this assembly when compiling each code module

The value specified is an assembly name – not a dll path. ASP+ will first perform a lookup on the supplied assembly name in order to find the physical dll location. A developer can optionally specify "*" to add every assembly within an application's private assembly cache – located within the "bin" sub-directory of an application.

  remove Removes assembly reference from compile settings. The value must explicitly match a previous "add" directive. Wildcard selections are not supported.
  clear Removes all assembly references currently contained in or inherited by a particular Config.web file.

Remarks

Several compiler names/extensions can be configured to work against the same ICompiler type. Simply add multiple <compiler> tags to the <compilation> section. This is shown in the following example.

Example:

<configsections>
   <add name="compilation"
         type=”System.Web.Config.CompilationConfigHandler”/>
</configsections>

<compilation debugmode="true"> 
   <compilers defaultlanguage=”VB”>
      <compiler language=”VB” 
                extension=”.cls”
                type=”MSVSA.dll#Microsoft.VB.Compiler” />
      <compiler language=”C#” 
                extension=”.cs” 
                type=”C#.dll#Microsoft.C#.Compiler” />
      <compiler language=”C#” 
                extension=”.cs” type=”
                C#.dll#Microsoft.C#.Compiler” />
   </compilers>

   <assemblies>
      <add assembly=”MyDll.dll” /> 
      <add assembly=”ADODB.dll” />
      <add assembly="*" />
   </assemblies>

</compilation>

Requirements

Contained Within: <configuration>

Web Platform: IIS 5.0

Configuration File: config.web

Configuration Section Handler:
System.Web.Config.CompilationConfigHandler

See Also

ASP+ Configuration Concepts