System.CodeDom.CodeCompileUnit Class

Provides a container for a CodeDOM program graph.

See Also: CodeCompileUnit Members


public class CodeCompileUnit : CodeObject


System.CodeDom.CodeCompileUnit provides a container for a CodeDOM program graph.

System.CodeDom.CodeCompileUnit contains a collection that can store System.CodeDom.CodeNamespace objects containing CodeDOM source code graphs, along with a collection of assemblies referenced by the project, and a collection of attributes for the project assembly.

A System.CodeDom.CodeCompileUnit can be passed to the System.CodeDom.Compiler.ICodeGenerator.GenerateCodeFromCompileUnit(CodeCompileUnit, System.IO.TextWriter, System.CodeDom.Compiler.CodeGeneratorOptions) method of an System.CodeDom.Compiler.ICodeGenerator implementation along with other parameters to generate code based on the program graph contained by the compile unit.


Some languages support only a single namespace that contains a single class in a compile unit.


Namespace: System.CodeDom
Assembly: System (in System.dll)
Assembly Versions: 1.0.3300.0, 1.0.5000.0,,