次の方法で共有


<compilation> 要素

ASP.NET で使用されるすべてのコンパイル設定値を構成します。

<configuration>
   <system.web>
      <compilation>

<compilation debug="true|false"              batch="true|false"             batchTimeout="number of seconds"             defaultLanguage="language"              explicit="true|false"              maxBatchSize="maximim number of pages per 
                           batched compilation"
             maxBatchGeneratedFileSize="maximum combined size (in KB) 
                                        of the generated source file per
                                        batched compilation"
             numRecompilesBeforeAppRestart="number"             strict="true|false"              tempDirectory="directory under which the ASP.NET temporary 
                            files are created">   <compilers>      <compiler language="language"                extension="ext"                type=".NET Type"                 warningLevel="number"                  compilerOptions="options"/>   </compilers>   <assemblies>      <add assembly="assembly"/>      <remove assembly="assembly"/>      <clear/>   </assemblies></compilation>

省略可能属性

属性 オプション 説明
debug     リテール バイナリまたはデバッグ バイナリのどちらをコンパイルするかを指定します。既定値は false です。
    true デバッグ バイナリのコンパイルを指定します。
    false リテール バイナリのコンパイルを指定します。
defaultLanguage     動的コンパイル ファイルで使用する "C#" や "PERL" などの既定のプログラミング言語を指定します。言語名は、<compiler> サブタグを使用して定義されます。既定値は vb です。
explicit     Microsoft Visual Basic explicit コンパイル オプションの設定値を示します。既定値は true です。
    true Visual Basic explicit コンパイル オプションが有効であり、DimPrivatePublicReDim の各ステートメントを使用してすべての変数を宣言する必要があることを示します。
    false Visual Basic explicit コンパイル オプションが無効であることを示します。
batch     バッチ処理がサポートされるかどうかを示します。
    true バッチ処理がサポートされることを示します。
    false バッチ処理がサポートされないことを示します。
batchTimeout     バッチ コンパイルのタイムアウトの時間を秒数で示します。タイムアウトの時間内にコンパイルを完了できない場合、コンパイラは現在のページの単一コンパイル モードに戻ります。
maxBatchGeneratedFileSize     バッチ コンパイルごとに生成されるソース ファイルの最大サイズ (KB 単位) を指定します。
maxBatchFileSize     バッチ コンパイルごとのページの最大数を指定します。
numRecompilesBeforeApprestart     アプリケーションが再起動されるまでに実行できるリソースの動的再コンパイルの数を示します。この属性は、グローバル レベルとアプリケーション レベルではサポートされますが、ディレクトリ レベルではサポートされません。
strict     Visual Basic strict コンパイル オプションの設定値を示します。
    true Visual Basic strict コンパイル オプションが有効であることを示します。
    false Visual Basic strict コンパイル オプションが無効であることを示します。
tempDirectory     コンパイル時に一時ファイル ストレージとして使用するディレクトリを指定します。

サブタグ

サブタグ 説明
<compilers> 新しいコンパイラ オプションを定義します。
<assemblies> ASP.NET コンパイル処理ディレクティブを指定します。

アプリケーションのコンパイル設定値を構成する例を次に示します。

<configuration>
   <system.web>
      <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>
   </system.web>
</configuration>

必要条件

格納されている場所 : <system.web>

Web プラットフォーム : IIS 5.0、IIS 5.1、IIS 6.0

構成ファイル : Machine.config、Web.config

構成セクション ハンドラ : System.Web.Configuration.CompilationConfigHandler

参照

ASP.NET の構成 | ASP.NET 設定スキーマ