System.Web.Compilation.AssemblyBuilder.AddCodeCompileUnit Method

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

Syntax

public void AddCodeCompileUnit (BuildProvider buildProvider, System.CodeDom.CodeCompileUnit compileUnit)

Parameters

buildProvider
The build provider generating compileUnit.
compileUnit
The code compile unit to include in the assembly compilation.

Remarks

A System.Web.Compilation.BuildProvider implementation calls the AssemblyBuilder.AddCodeCompileUnit(BuildProvider, System.CodeDom.CodeCompileUnit) method when generating a CodeDOM graph for a virtual path. Source code added with AssemblyBuilder.AddCodeCompileUnit(BuildProvider, System.CodeDom.CodeCompileUnit) is included in the assembly compilation.

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

Requirements

Namespace: System.Web.Compilation
Assembly: System.Web (in System.Web.dll)
Assembly Versions: 2.0.0.0
Since: .NET 2.0