System.CodeDom.Compiler.CompilerParameters Class

Assembly: System.dll
Namespace: System.CodeDom.Compiler
Summary
Represents the parameters used to invoke the compiler.
C# Syntax:
public class CompilerParameters
Remarks
CompilerParameters encapsulates the options used when invoking compilation through an instance of the ICodeCompiler interface.
See also:
System.CodeDom.Compiler Namespace

System.CodeDom.Compiler.CompilerParameters Member List:

Public Constructors
ctor #1 Overloaded:
.ctor()

Default constructor. This constructor is called by derived class constructors to initialize state in this type.
Initializes a new instance of the CompilerParameters class.
ctor #2 Overloaded:
.ctor(string[] assemblyNames)

Initializes a new instance of the CompilerParameters class using the specified assembly names.
ctor #3 Overloaded:
.ctor(string[] assemblyNames, string outputName)

Initializes a new instance of the CompilerParameters class using the specified assembly names and output file name.
ctor #4 Overloaded:
.ctor(string[] assemblyNames, string outputName, bool includeDebugInformation)

Initializes a new instance of the CompilerParameters class using the specified assembly names, output name, and a value indicating whether to include debug information.
Public Properties
CompilerOptions Read-write

Gets or sets the compiler options for the compiler to use.
GenerateExecutable Read-write

Gets or sets a value indicating whether to generate an executable.
GenerateInMemory Read-write

Gets or sets a value indicating whether to generate the output in memory.
IncludeDebugInformation Read-write

Gets or sets a value indicating whether to include debug information in the compiled executable.
MainClass Read-write

Gets or sets the name of the main class.
OutputAssembly Read-write

Gets or sets the name of the output assembly.
ReferencedAssemblies Read-only

Gets or sets the assemblies referenced by the current project.
TempFiles Read-write

Gets or sets the temporary files to use.
TreatWarningsAsErrors Read-write

Gets or sets a value indicating whether to treat warnings as errors.
UserToken Read-write

Gets or sets the user token to use when creating the compiler process.
WarningLevel Read-write

Gets or sets the warning level at which the compiler aborts compilation.
Win32Resource Read-write

Gets or sets the filename of a Win32 resource file to link into the compiled assembly.
Public Methods
Equals
(inherited from System.Object)
See base class member description: System.Object.Equals

Derived from System.Object, the primary base class for all objects.
GetHashCode
(inherited from System.Object)
See base class member description: System.Object.GetHashCode

Derived from System.Object, the primary base class for all objects.
GetType
(inherited from System.Object)
See base class member description: System.Object.GetType

Derived from System.Object, the primary base class for all objects.
ToString
(inherited from System.Object)
See base class member description: System.Object.ToString

Derived from System.Object, the primary base class for all objects.
Protected Methods
Finalize
(inherited from System.Object)
See base class member description: System.Object.Finalize

Derived from System.Object, the primary base class for all objects.
MemberwiseClone
(inherited from System.Object)
See base class member description: System.Object.MemberwiseClone

Derived from System.Object, the primary base class for all objects.

Hierarchy:


System.CodeDom.Compiler.CompilerParameters Member Details

Overloaded ctor #1
Summary
Initializes a new instance of the CompilerParameters class.

Default constructor. This constructor is called by derived class constructors to initialize state in this type.
C# Syntax:
public CompilerParameters();

Return to top


Overloaded ctor #2
Summary
Initializes a new instance of the CompilerParameters class using the specified assembly names.
C# Syntax:
public CompilerParameters(
   string[] assemblyNames
);
Parameters:

assemblyNames

The names of the assemblies to compile.

Return to top


Overloaded ctor #3
Summary
Initializes a new instance of the CompilerParameters class using the specified assembly names and output file name.
C# Syntax:
public CompilerParameters(
   string[] assemblyNames,
   string outputName
);
Parameters:

assemblyNames

The names of the assemblies to compile.

outputName

The output file name.

Return to top


Overloaded ctor #4
Summary
Initializes a new instance of the CompilerParameters class using the specified assembly names, output name, and a value indicating whether to include debug information.
C# Syntax:
public CompilerParameters(
   string[] assemblyNames,
   string outputName,
   bool includeDebugInformation
);
Parameters:

assemblyNames

The names of the assembly(s) to compile.

outputName

The output file name.

includeDebugInformation

true if debug information should be included; false if debug information should be excluded.

Return to top


Property: CompilerOptions (read-write)
Summary
Gets or sets the compiler options for the compiler to use.
C# Syntax:
public string CompilerOptions {get; set;}
Remarks
An ICodeCompiler typically includes this string on the command line if invoking a command line compiler.

Return to top


Property: GenerateExecutable (read-write)
Summary
Gets or sets a value indicating whether to generate an executable.
C# Syntax:
public bool GenerateExecutable {get; set;}
Remarks
If this property is false, a DLL will be generated.

Return to top


Property: GenerateInMemory (read-write)
Summary
Gets or sets a value indicating whether to generate the output in memory.
C# Syntax:
public bool GenerateInMemory {get; set;}

Return to top


Property: IncludeDebugInformation (read-write)
Summary
Gets or sets a value indicating whether to include debug information in the compiled executable.
C# Syntax:
public bool IncludeDebugInformation {get; set;}

Return to top


Property: MainClass (read-write)
Summary
Gets or sets the name of the main class.
C# Syntax:
public string MainClass {get; set;}
Remarks
The main class contains the entry point for the program.

Return to top


Property: OutputAssembly (read-write)
Summary
Gets or sets the name of the output assembly.
C# Syntax:
public string OutputAssembly {get; set;}

Return to top


Property: ReferencedAssemblies (read-only)
Summary
Gets or sets the assemblies referenced by the current project.
C# Syntax:
public StringCollection ReferencedAssemblies {get;}
Remarks
The string collection should consist of, or include, the assemblies referenced by the current project.
See also:
StringCollection

Return to top


Property: TempFiles (read-write)
Summary
Gets or sets the temporary files to use.
C# Syntax:
public TempFileCollection TempFiles {get; set;}

Return to top


Property: TreatWarningsAsErrors (read-write)
Summary
Gets or sets a value indicating whether to treat warnings as errors.
C# Syntax:
public bool TreatWarningsAsErrors {get; set;}

Return to top


Property: UserToken (read-write)
Summary
Gets or sets the user token to use when creating the compiler process.
C# Syntax:
public IntPtr UserToken {get; set;}

Return to top


Property: WarningLevel (read-write)
Summary
Gets or sets the warning level at which the compiler aborts compilation.
C# Syntax:
public int WarningLevel {get; set;}

Return to top


Property: Win32Resource (read-write)
Summary
Gets or sets the filename of a Win32 resource file to link into the compiled assembly.
C# Syntax:
public string Win32Resource {get; set;}
Remarks
Not all languages support Win32Resource files, so you should test a code generator for this support by calling ICodeGenerator.Supports with the flag GeneratorSupport.Win32Resources.

Return to top


Method: Equals(
   object obj
)
Inherited
See base class member description: System.Object.Equals
C# Syntax:
public virtual bool Equals(
   object obj
);

For more information on members inherited from System.Object click on the link above.

Return to top


Method: Finalize()
Inherited
See base class member description: System.Object.Finalize
C# Syntax:
~CompilerParameters();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetHashCode()
Inherited
See base class member description: System.Object.GetHashCode
C# Syntax:
public virtual int GetHashCode();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: GetType()
Inherited
See base class member description: System.Object.GetType
C# Syntax:
public Type GetType();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: MemberwiseClone()
Inherited
See base class member description: System.Object.MemberwiseClone
C# Syntax:
protected object MemberwiseClone();

For more information on members inherited from System.Object click on the link above.

Return to top


Method: ToString()
Inherited
See base class member description: System.Object.ToString
C# Syntax:
public virtual string ToString();

For more information on members inherited from System.Object click on the link above.

Return to top


Top of page

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