compilation の buildProviders 要素 (ASP.NET 設定スキーマ)

[このドキュメントはプレビューのみを目的としており、以降のリリースで変更される可能性があります。プレースホルダーとして空白のトピックが含まれています。]

カスタム リソース ファイルをコンパイルするために使用されるビルド プロバイダーのコレクションを定義します。

<buildProviders> 
   <add />
   <clear/>
   <remove />
</buildProviders>

属性および要素

以降のセクションでは、属性、子要素、および親要素について説明します。

属性

なし。

子要素

サブタグ

Description

add

省略可能な要素です。

コレクションにビルド プロバイダーを追加します。

clear

省略可能な要素です。

継承したビルド プロバイダーへのすべての参照を削除し、現在の add 要素によって追加されたビルド プロバイダーだけを使用できるようにします。

remove

省略可能な要素です。

継承したビルド プロバイダーへの参照をコレクションから削除します。

親要素

要素

Description

configuration

共通言語ランタイムおよび .NET Framework アプリケーションで使用されるすべての構成ファイルのルート要素を指定します。

system.web

ASP.NET 構成セクションのルート要素を指定します。

compilation

ASP.NET でアプリケーションのコンパイルに使用されるすべてのコンパイル設定値を構成します。

解説

buildProviders 要素は、コンパイル時に、特定のファイルの種類のカスタム リソース ファイルをコンパイルしてコードを生成するために使用されるビルド プロバイダーのコレクションを定義します。

ASP.NET アプリケーション内のファイルの種類に対するカスタム ビルド アクションを定義するには、BuildProvider からクラスを派生させ、ファイルの種類をビルドするための派生クラス内にメンバーを実装し、アプリケーション構成ファイル内で対応する拡張子のビルド プロバイダーを構成します。 詳細については、「BuildProvider」を参照してください。

既定の構成

次の既定の buildProviders 要素は、Machine.config ファイルまたはルートの Web.config ファイルでは明示的に構成されません。 ただし、これはアプリケーションが返す既定の構成です。 項目は、ルート Web.config ファイル内の buildProviders コレクションに追加されます。

<buildProviders>
   <clear />
</buildProviders>

次に示す既定の buildProviders 要素は、ルート Web.config ファイル内で構成されます。

<buildProviders>
   <add extension=".aspx" type="System.Web.Compilation.PageBuildProvider"/>
   <add extension=".ascx" type="System.Web.Compilation.UserControlBuildProvider"/>
   <add extension=".master" type="System.Web.Compilation.MasterPageBuildProvider"/>
   <add extension=".asix" type="System.Web.Compilation.ImageGeneratorBuildProvider"/>
   <add extension=".asmx" type="System.Web.Compilation.WebServiceBuildProvider"/>
   <add extension=".ashx" type="System.Web.Compilation.WebHandlerBuildProvider"/>
   <add extension=".soap" type="System.Web.Compilation.WebServiceBuildProvider"/>
   <add extension=".resx" type="System.Web.Compilation.ResXBuildProvider"/>
   <add extension=".resources" type="System.Web.Compilation.ResourcesBuildProvider"/>
   <add extension=".wsdl" type="System.Web.Compilation.WsdlBuildProvider"/>
   <add extension=".xsd" type="System.Web.Compilation.XsdBuildProvider"/>
   <add extension=".js" type="System.Web.Compilation.ForceCopyBuildProvider"/>
</buildProviders>

使用例

指定した拡張子を持つカスタム リソース ファイルのコンパイルに使用されるビルド プロバイダーを定義する方法を次のコード例に示します。

<configuration>
   <system.web>
      <compilation>
         <buildProviders>
            <buildProvider 
               extension=".mafx" 
               type="MyBuildProviderType, MyBuildProviderAssembly" />
         </buildProviders>
      </compilation>
   </system.web>
</configuration>

要素情報

構成セクション ハンドラー

CompilationSection

構成メンバー

BuildProviders

BuildProviderCollection

構成できる場所

Machine.config

ルート レベルの Web.config

アプリケーション レベルの Web.config

仮想ディレクトリ レベルまたは物理ディレクトリ レベルの Web.config

要件

Microsoft Internet Information Services (IIS) 5.0、5.1、または 6.0

.NET Framework 2.0

Microsoft Visual Studio 2003 または Visual Studio 2005

参照

処理手順

How to: Configure Specific Folders Using Location Settings

How to: Lock ASP.NET Configuration Settings

Reference

compilation 要素 (ASP.NET 設定スキーマ)

compilation の buildProviders の add 要素 (ASP.NET 設定スキーマ)

compilation の buildProviders の clear 要素 (ASP.NET 設定スキーマ)

compilation の buildProviders の remove 要素 (ASP.NET 設定スキーマ)

compilation の assemblies 要素 (ASP.NET 設定スキーマ)

compilation の codeSubDirectories 要素 (ASP.NET 設定スキーマ)

compilation の compilers 要素 (ASP.NET 設定スキーマ)

コンパイルに使用する expressionBuilders 要素 (ASP.NET 設定スキーマ)

configuration 要素 (全般設定スキーマ)

system.web 要素 (ASP.NET 設定スキーマ)

System.Configuration

System.Web.Configuration

CompilationSection

BuildProviders

BuildProviderCollection

概念

ASP.NET Compilation Model

ASP.NET Web Page Syntax Overview

ASP.NET Configuration File Hierarchy

Securing Configuration

Configuration Inheritance

その他の技術情報

全般構成設定 (ASP.NET)

ASP.NET 構成設定

Configuring ASP.NET Applications

ASP.NET Configuration Files

ASP.NET Configuration API