System.Web 2.0.0.0 System.Object

The ASP.NET build environment uses objects to generate source code for different file types within an application. Classes derived from predominantly provide source code for files, Web pages, resources, and other custom items.

Typically, you do not create an instance of the class directly. Instead, you implement a class that derives from , and configure the implementation for use within the ASP.NET build environment.

Instances of the class are used with objects to build one or more files into a compiled assembly. A instance generates source code in the appropriate language for individual files, and the object combines the source contributed by each instance into a single assembly.

The ASP.NET build environment uses instances of the class to build files within an application. The property of the class indicates the path of the file to be built. The file extension of each file within an application is mapped to a corresponding build provider. The ASP.NET build environment initializes a instance for each file based on the file extension, and uses the methods to generate source code for the file. The ASP.NET build environment passes an object based on the preferred compiler language and the context of the file to the methods when building an assembly from one or more files, so that the instance can contribute source code for its file to the overall assembly.

To define custom build actions for a file type within an ASP.NET application, you must derive a class from , 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.

The add element specifies the file extension for supported files, and whether the build provider supports code files, Web files, resource files or all files. Use the type attribute to specify the fully qualified type name of the build provider implementation. Use the class to specify whether the build provider applies to files in the App_Code directory, to files in a Web content directory, to global or local resources, or to all files. Use the extension attribute to specify the file extension used to identify files that the class supports. Use the class to examine build providers in a configuration file. For more information about configuring a build provider, see buildproviders Element for compilation (ASP.NET Settings Schema).

To implement a build provider that generates source code for a custom file type, derive a class from , and override the method to generate source code for the supported file type. The generated source is added to the object in the form of a CodeDOM graph, or as content that represents a physical source code file. If the build provider requires a specific programming language, override the property to return a object for the supported programming language. If the build provider does not require a specific programming language, do not override the property; use the base class implementation, which indicates that the build provider can use any .NET Framework language, such as Visual Basic or C#.

To implement a build provider that generates source code for Web content, derive a class from and override the method to return the for the class generated by . Override the method to generate source code for the type provided by the supported file.

Adding a customized class to the Web.config file works in an ASP.NET Web site but does not work in an ASP.NET Web application project. In a Web application project, the code that is generated by the class cannot be included in the application. For more information, see Compiling Web Application Projects.

Defines a set of properties and methods for generating source code within the ASP.NET build environment. This class is abstract.

- Constructor

  Because the class is abstract, you cannot create an instance of directly using the constructor.

  When deriving from the class, override the constructor to implement custom initialization actions for your build provider implementation.

  Initializes a new instance of the class.

  2.0.0.0
- Property
  System.Web.Compilation.CompilerType To be added.

  Use the property to provide the settings for compiling source code for an implementation of . The property is null if the build provider does not require a specific code language for generating and compiling source code.

  To set the value for a object within a build provider implementation, use the or method.

  The property specifies the implementation that is used to generate and compile source code for a build provider. The property defines the settings that are used to compile the source code into an assembly.

  Represents the compiler type used by a build provider to generate source code for a custom file type.

  2.0.0.0
- Method
  System.Void ``

  To implement a build provider that generates source code for a custom file type, derive a class from the class, and override the method to generate source code for the supported file type.

  Typically, a build provider's implementation reads the property, parses the contents, and adds the generated source code to the specified object. You can contribute source code to the assembly in the form of a object or a CodeDOM graph. To add source code to the assembly through a object, use the method. To add source code in a CodeDOM graph to the assembly, use the method.

  If the build provider generates source code in a specific programming language, you must override the property to return a object for the supported programming language.

  Generates source code for the virtual path of the build provider, and adds the source code to a specified assembly builder.

  The assembly builder that references the source code generated by the build provider. 2.0.0.0
- Method
  System.String ``

  The method of a object creates an instance of a build provider for an input virtual path, and calls the method on the object.

  The base class returns null for the method, indicating that is not implemented.

  Certain build provider implementations can implement in place of the method. A object typically uses to return a object for a virtual path. However, the method can be used to indicate that a object can generate multiple types from a virtual path.

  Generates a string to be persisted in the compiled assembly.

  A string to be persisted in the build environment, or null if the instance does not implement .

  The compilation results for the build provider's virtual path. 2.0.0.0
- Method
  System.Web.Compilation.CompilerType

  Use the method to examine the default compiler type for a build provider. Use the method to examine the compiler type configured in a build provider for a specific language name.

  The base class determines the default compiler type using the defaultLanguage attribute value in the compilation section of the application configuration file. If there is no default language setting in the compilation section, the default compiler type is set using the language provider.

  When deriving from the class, you can use to set the property within your implementation.

  Returns the compiler settings for the default language in the application.

  A that represents the compiler settings for the default language in the application. The base class returns the default compiler based on the application configuration file.

  2.0.0.0
- Method
  System.Web.Compilation.CompilerType ``

  Use the method to examine the compiler type configured in the build provider for a specific language name. Use the method to examine the default compiler type for a build provider.

  The base class determines the default compiler type using the elements in the property of the object for the configuration file. This is equivalent to examining the compiler elements in the system.web and the compiler elements in the system.codedom sections of the configuration file. For example, for the value VB, the base class method returns a object that corresponds to the configured settings for an instance of .

  When you derive from the class, you can use to set the property value for the language supported by your implementation.

  Returns the compiler settings for the build provider based on the specified language.

  A that represents the compiler settings for the build provider based on the specified language. The base class returns the default compiler settings for the language based on the application configuration file.

  A code language name. 2.0.0.0
- Method
  System.Type ``

  To implement a build provider that generates source code for Web content such as .aspx files, derive a class from the class and override the method to return the type generated by the build provider.

  The ASP.NET build system compiles files for each build provider, and generates a object, which is passed to the method. Typically, a build provider's implementation uses the method on the property of the input object to return the provided type.

  Returns a type generated by the build provider from the virtual path.

  The type that is generated by the build provider for the virtual path. The base class returns null.

  The compilation results for the build provider's virtual path. 2.0.0.0
- Method
  System.Web.Compilation.BuildProviderResultFlags ``

  The method is used by the ASP.NET build environment when using instances of the class to build files and load the compiled assemblies.

  The base class method returns the field value, indicating that no special action is required when the virtual path is built.

  When deriving from the class, you can implement the method to return a different value for your custom file type or virtual path. For example, if a rebuild of your virtual path requires the containing object to be reloaded, you can return the enumeration value from your method.

  Returns a value indicating actions required when a virtual path is built.

  A value indicating actions required after the virtual path is built within the ASP.NET build environment.

  The compilation results for the build provider's virtual path. 2.0.0.0
- Method
  System.IO.TextReader

  Use the method on the returned object to read the contents of the property for a object.

  After calling the method, you must use the method to close the object and free associated system resources.

  Opens a text reader for reading from the virtual path of the current build provider object.

  An open that can be used to read the contents of the .

  2.0.0.0
- Method
  System.IO.TextReader ``

  Use the method on the returned object to read the contents of the virtual path.

  After calling the method, you must use the method to close the object and free associated system resources.

  Opens a text reader for reading from a specified virtual path.

  An open that can be used to read the contents of the specified virtual path.

  The virtual path to read. 2.0.0.0
- Method
  System.IO.Stream

  Use the method on the returned object to read the contents of the virtual path for the object.

  After calling the method, you must use the method to close the object and free associated system resources.

  Opens a stream for reading the virtual path of the current build provider object.

  An open that can be used to read the contents of the .

  2.0.0.0
- Method
  System.IO.Stream ``

  Use the method on the returned object to read the contents of the virtual path.

  After calling the method, you must use the method to close the object and free associated system resources.

  Opens a stream for reading from a specified virtual path.

  An open that can be used to read the contents of the specified virtual path.

  The virtual path to read. 2.0.0.0
- Property
  System.Collections.ICollection To be added.

  The ASP.NET build environment initializes the collection of assemblies that are available for reference by the build provider. The source code generated by a build provider can use public types in the referenced assemblies. The referenced assembly collection consists of other assemblies built in the ASP.NET application, and assemblies listed in the assemblies element in the configuration file.

  If the build provider generates source code that references additional assemblies, the build provider adds the additional assemblies using the method. The ASP.NET build environment resolves external types during assembly compilation using both the referenced assemblies added by build providers and the default collection of assemblies available for reference.

  The collection does not include assemblies that are added for reference by other build providers through the method.

  Represents the assemblies to compile with the source generated by the build provider.

  2.0.0.0
- Property
  2.0.0.0
  System.String To be added.

  The virtual path of a object is the path to the file that is being compiled by the build provider. For example, if you have configured a custom class to build all files in the Web site with the custom extension of .abc, if your Web site is named WebSite1, and the Web site contains a file named Example.abc, the property contains the value /WebSite1/Example.abc.

  The file extension of each file within the application determines the file type, and the corresponding build provider for the file type. The ASP.NET build environment initializes a object for each file based on the file type, and uses the methods to generate source for each file.

  For more information about configuring a build provider, see buildproviders Element for compilation (ASP.NET Settings Schema).

  Represents the file to be built by this build provider implementation.

- Property
  System.Collections.ICollection To be added.

  The property is a collection of virtual paths that must be compiled before the instance generates source code. The assemblies from the virtual paths in are added as references to the compilation for the instance.

  Represents a collection of virtual paths that must be built before the build provider generates code.

  2.0.0.0