This documentation is archived and is not being maintained.

add Element for buildProviders for compilation (ASP.NET Settings Schema)

Adds a build provider to the collection.

This element is new in the .NET Framework version 2.0.

   extension="custom resource file extension"
   type="build provider type, build provider assembly"
   Code | Resources | All"

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


Attribute Description


Required String attribute.

Defines the custom resource file extension. This attribute is the collection key.

The default is an empty string ("").


Required String attribute.

Defines the type and assembly to use to compile the files that are specified by the extension attribute.

The default is an empty string ("").

Child Elements


Parent Elements

Element Description


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


Specifies the root element for the ASP.NET configuration section.


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


Defines a collection of build providers that are used to compile custom resource files.

The add element adds a build provider to the collection in the buildproviders element.

The buildProviders element defines a collection of build providers that are used to compile custom resource files of a particular file type and to generate code during compilation.

To define custom build actions for a file type within an ASP.NET application, you must derive a class from the BuildProvider class, implement members within the derived class for building the file type, and configure the build provider for the corresponding file extension within the application configuration file. For information, see BuildProvider.

The following default buildProviders element is configured in the root Web.config file.

   <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" />

The following code example demonstrates how to define a build provider that is used to compile custom resource files with the specified extension.

               type="MyBuildProviderType, MyBuildProviderAssembly"/>

Configuration section handler


Configuration member


Configurable Locations


Root-level Web.config

Application-level Web.config

Virtual or physical directory–level Web.config


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

The .NET Framework version 2.0

Microsoft Visual Studio 2003 or Visual Studio 2005