System.CodeDom.Compiler.ICodeCompiler Interface

Assembly: System.dll
Namespace: System.CodeDom.Compiler
Summary
Provides a compiler execution interface.
C# Syntax:
public interface ICodeCompiler
Remarks
This interface can be implemented to compile assemblies from Code Document Object Model (CodeDOM) compile units, strings containing source code, or source code files. This interface is well suited to compiling assemblies with dynamic content from CodeDom trees.

ICodeCompiler provides the capability to invoke compilation with specified parameters at runtime and access information related to compilation, including the result code, and any errors and warnings the compiler returns. File and line number information can also be reported for each error or wanring, so that user code to locate the code generating an error or warning can be implemented.

Each compilation invoking method accepts a CompilerParameters object that indicates compiler settings, and returns a CompilerResults object to indicate the results of compilation.

Compiler developers should provide an implementation of this interface to support dynamic compilation.

See also:
System.CodeDom.Compiler Namespace | CompilerParameters | CompilerResults

System.CodeDom.Compiler.ICodeCompiler Member List:

Public Methods
CompileAssemblyFromDom Creates an assembly based on the System.CodeDom tree contained in the specified CodeCompileUnit, using the specified options.
CompileAssemblyFromDomBatch Creates an assembly based on the System.CodeDom trees contained in the specified CodeCompileUnit, using the specified options.
CompileAssemblyFromFile Creates an assembly based on the specified options and file name.
CompileAssemblyFromFileBatch Creates an assembly based on the specified options and file names.
CompileAssemblyFromSource Creates an assembly based on the specified options and source.
CompileAssemblyFromSourceBatch Creates an assembly based on the specified options and sources.

System.CodeDom.Compiler.ICodeCompiler Member Details

Method: CompileAssemblyFromDom(
   CompilerParameters options,
   CodeCompileUnit compilationUnit
)
Summary
Creates an assembly based on the System.CodeDom tree contained in the specified CodeCompileUnit, using the specified options.
C# Syntax:
CompilerResults CompileAssemblyFromDom(
   CompilerParameters options,
   CodeCompileUnit compilationUnit
);
Parameters:

options

A CompilerParameters object that indicates the compiler options.

compilationUnit

A CodeCompileUnit that indicates the code to compile.

Return Value:
A CompilerResults object that indicates the results of compilation.
See also:
CompilerParameters | CodeNamespace | CodeCompileUnit | CompilerResults

Return to top


Method: CompileAssemblyFromDomBatch(
   CompilerParameters options,
   CodeCompileUnit[] compilationUnits
)
Summary
Creates an assembly based on the System.CodeDom trees contained in the specified CodeCompileUnit, using the specified options.
C# Syntax:
CompilerResults CompileAssemblyFromDomBatch(
   CompilerParameters options,
   CodeCompileUnit[] compilationUnits
);
Parameters:

options

A CompilerParameters object that indicates the compiler options.

compilationUnits

An array of type CodeCompileUnit that indicates the code to compile.

Return Value:
A CompilerResults object that indicates the results of compilation.
See also:
CompilerParameters | CodeCompileUnit | CompilerResults

Return to top


Method: CompileAssemblyFromFile(
   CompilerParameters options,
   string fileName
)
Summary
Creates an assembly based on the specified options and file name.
C# Syntax:
CompilerResults CompileAssemblyFromFile(
   CompilerParameters options,
   string fileName
);
Parameters:

options

A CompilerParameters object that indicates the compiler options.

fileName

The file name of the file to compile.

Return Value:
A CompilerResults object that indicates the results of compilation.
See also:
CompilerParameters | CompilerResults

Return to top


Method: CompileAssemblyFromFileBatch(
   CompilerParameters options,
   string[] fileNames
)
Summary
Creates an assembly based on the specified options and file names.
C# Syntax:
CompilerResults CompileAssemblyFromFileBatch(
   CompilerParameters options,
   string[] fileNames
);
Parameters:

options

A CompilerParameters object that indicates the compiler options.

fileNames

The file names of the files to compile.

Return Value:
A CompilerResults object that indicates the results of compilation.
See also:
CompilerParameters | CompilerResults

Return to top


Method: CompileAssemblyFromSource(
   CompilerParameters options,
   string source
)
Summary
Creates an assembly based on the specified options and source.
C# Syntax:
CompilerResults CompileAssemblyFromSource(
   CompilerParameters options,
   string source
);
Parameters:

options

A CompilerParameters object that indicates the compiler options.

source

The source to compile.

Return Value:
A CompilerResults object that indicates the results of compilation.
See also:
CompilerParameters | CompilerResults

Return to top


Method: CompileAssemblyFromSourceBatch(
   CompilerParameters options,
   string[] sources
)
Summary
Creates an assembly based on the specified options and sources.
C# Syntax:
CompilerResults CompileAssemblyFromSourceBatch(
   CompilerParameters options,
   string[] sources
);
Parameters:

options

A CompilerParameters object that indicates the compiler options.

sources

The source code strings to compile.

Return Value:
A CompilerResults object that indicates the results of compilation.
See also:
CompilerParameters | CompilerResults

Return to top


Top of page

Copyright (c) 2002 Microsoft Corporation. All rights reserved.