AssemblyBuilder Class
Assembly: System.Web (in system.web.dll)
Instances of the AssemblyBuilder class are used with BuildProvider class methods to build one or more files into a compiled assembly.
The BuildProvider class defines build functionality for individual files, and the AssemblyBuilder class combines the source code contributed by each BuildProvider instance into a single assembly. The ASP.NET build environment passes an AssemblyBuilder object to the BuildProvider methods when building an assembly from one or more files, so that each BuildProvider instance can contribute source code for its file to the overall assembly.
The ASP.NET build environment determines the language and compiler required by files within the project, based on the BuildProvider.CodeCompilerType property. The build environment groups files based on their compiler settings and builds an assembly from files that require the same compiler.
The CodeDomProvider property indicates the CodeDomProvider implementation that the ASP.NET build environment uses to compile an assembly from the source code contributed by each BuildProvider implementation.
A BuildProvider object contributes source code in the form of a CodeDOM graph using the AddCodeCompileUnit method. A BuildProvider object contributes source code stored in a physical file using the CreateCodeFile method.
After each BuildProvider object contributes source code using the appropriate AssemblyBuilder methods, the ASP.NET build environment uses the AssemblyBuilder class to compile the collected source code into an assembly.
| Topic | Location |
|---|---|
| How To: Secure an ASP.NET Application on a Shared Server | Building ASP .NET Web Applications |
| How To: Secure an ASP.NET Application on a Shared Server | Building ASP .NET Web Applications |
The following code example illustrates a simple build provider implementation, inheriting from the abstract BuildProvider base class. The build provider overrides the CodeCompilerType, GetGeneratedType, and GenerateCode members of the base class.
In the GenerateCode method implementation, the build provider adds the generated code for the assembly compilation using the CreateCodeFile method.
Windows 98, Windows Server 2000 SP4, Windows Millennium Edition, Windows Server 2003, Windows XP Media Center Edition, Windows XP Professional x64 Edition, Windows XP SP2, Windows XP Starter Edition
The Microsoft .NET Framework 3.0 is supported on Windows Vista, Microsoft Windows XP SP2, and Windows Server 2003 SP1.