This documentation is archived and is not being maintained.

AssemblyBuilder::AddCodeCompileUnit Method

Adds source code for the assembly in the form of a CodeDOM graph.

Namespace:  System.Web.Compilation
Assembly:  System.Web (in System.Web.dll)

public:
void AddCodeCompileUnit(
	BuildProvider^ buildProvider, 
	CodeCompileUnit^ compileUnit
)

Parameters

buildProvider
Type: System.Web.Compilation::BuildProvider
The build provider generating compileUnit.
compileUnit
Type: System.CodeDom::CodeCompileUnit
The code compile unit to include in the assembly compilation.

A BuildProvider implementation calls the AddCodeCompileUnit method when generating a CodeDOM graph for a virtual path. Source code added with AddCodeCompileUnit is included in the assembly compilation.

Typically, a build provider's GenerateCode method implementation reads the VirtualPath property, parses the contents, and then adds the generated source code to the specified AssemblyBuilder object. The build provider uses the AddCodeCompileUnit method to add source code as a CodeDOM graph to the assembly. Alternately, the build provider can use the CreateCodeFile method to add source code as a physical file to the assembly.

.NET Framework

Supported in: 4, 3.5, 3.0, 2.0

Windows 7, Windows Vista SP1 or later, Windows XP SP3, Windows XP SP2 x64 Edition, Windows Server 2008 (Server Core not supported), Windows Server 2008 R2 (Server Core supported with SP1 or later), Windows Server 2003 SP2

The .NET Framework does not support all versions of every platform. For a list of the supported versions, see .NET Framework System Requirements.
Show: