CompilationOptions Class

Definition

Represents compilation options common to C# and VB.

public ref class CompilationOptions abstract
public abstract class CompilationOptions
type CompilationOptions = class
Public MustInherit Class CompilationOptions
Inheritance
CompilationOptions
Derived

Properties

AssemblyIdentityComparer

Used to compare assembly identities. May implement unification and portability policies specific to the target platform. Default if not specified.

CheckOverflow

Whether bounds checking on integer arithmetic is enforced by default or not.

ConcurrentBuild

Specifies whether building compilation may use multiple threads.

CryptoKeyContainer

The CSP container containing the key with which to sign the output.

CryptoKeyFile

The name of the file containing the public and private keys to use to generate strong name of the compilation assembly and to sign it.

CryptoPublicKey

Specifies public key used to generate strong name for the compilation assembly, or empty if not specified.

DelaySign

Mark the compilation assembly as delay-signed.

Deterministic

Specifies whether the compilation should be deterministic.

Errors

Errors collection related to an incompatible set of compilation options

Features
Obsolete.

A set of strings designating experimental compiler features that are to be enabled.

GeneralDiagnosticOption

Global warning report option

Language

Gets the source language ("C#" or "Visual Basic").

MainTypeName

The full name of a type that declares static Main method. Must be a valid non-generic namespace-qualified name. Null if any static Main method is a candidate for an entry point.

MetadataImportOptions

Specifies whether to import members with accessibility other than public or protected by default. Default value is Public. The value specified is not going to affect correctness of analysis performed by compilers because all members needed for correctness are going to be imported regardless. This setting can force compilation to import members that it normally doesn't.

MetadataReferenceResolver

Resolves paths to metadata references specified in source via #r directives. Null if the compilation can't contain references to metadata other than those explicitly passed to its factory (such as #r directives in sources).

ModuleName

Name of the primary module, or null if a default name should be used.

NullableContextOptions

Gets the default nullable context state in this compilation.

OptimizationLevel

Specifies whether or not optimizations should be performed on the output IL. This is independent of whether or not PDB information is generated.

OutputKind

The kind of assembly generated when emitted.

Platform

Specifies which version of the common language runtime (CLR) can run the assembly.

PublicSign

Mark the compilation assembly as fully signed, but only sign with the public key.

ReportSuppressedDiagnostics

Whether diagnostics suppressed in source, i.e. IsSuppressed is true, should be reported.

ScriptClassName

The full name of a global implicit class (script class). This class implicitly encapsulates top-level statements, type declarations, and member declarations. Could be a namespace qualified name.

SourceReferenceResolver

Gets the resolver for resolving source document references for the compilation. Null if the compilation is not allowed to contain source file references, such as #line pragmas and #load directives.

SpecificDiagnosticOptions

Warning report option for each warning.

StrongNameProvider

Provides strong name and signature the source assembly. Null if assembly signing is not supported.

SyntaxTreeOptionsProvider

Provider to retrieve options for particular syntax trees.

WarningLevel

Global warning level (a non-negative integer).

XmlReferenceResolver

Gets the resolver for resolving XML document references for the compilation. Null if the compilation is not allowed to contain XML file references, such as XML doc comment include tags and permission sets stored in an XML file.

Methods

CommonWithAssemblyIdentityComparer(AssemblyIdentityComparer)
CommonWithCheckOverflow(Boolean)
CommonWithConcurrentBuild(Boolean)
CommonWithCryptoKeyContainer(String)
CommonWithCryptoKeyFile(String)
CommonWithCryptoPublicKey(ImmutableArray<Byte>)
CommonWithDelaySign(Nullable<Boolean>)
CommonWithDeterministic(Boolean)
CommonWithFeatures(ImmutableArray<String>)
CommonWithGeneralDiagnosticOption(ReportDiagnostic)
CommonWithMainTypeName(String)
CommonWithMetadataImportOptions(MetadataImportOptions)
CommonWithMetadataReferenceResolver(MetadataReferenceResolver)
CommonWithModuleName(String)
CommonWithOptimizationLevel(OptimizationLevel)
CommonWithOutputKind(OutputKind)
CommonWithPlatform(Platform)
CommonWithPublicSign(Boolean)
CommonWithReportSuppressedDiagnostics(Boolean)
CommonWithScriptClassName(String)
CommonWithSourceReferenceResolver(SourceReferenceResolver)
CommonWithSpecificDiagnosticOptions(IEnumerable<KeyValuePair<String,ReportDiagnostic>>)
CommonWithSpecificDiagnosticOptions(ImmutableDictionary<String,ReportDiagnostic>)
CommonWithStrongNameProvider(StrongNameProvider)
CommonWithSyntaxTreeOptionsProvider(SyntaxTreeOptionsProvider)
CommonWithXmlReferenceResolver(XmlReferenceResolver)
ComputeHashCode()
Equals(Object)
EqualsHelper(CompilationOptions)
GetHashCode()
GetHashCodeHelper()
WithAssemblyIdentityComparer(AssemblyIdentityComparer)
WithConcurrentBuild(Boolean)

Creates a new options instance with the concurrent build property set accordingly.

WithCryptoKeyContainer(String)
WithCryptoKeyFile(String)
WithCryptoPublicKey(ImmutableArray<Byte>)
WithDelaySign(Nullable<Boolean>)
WithDeterministic(Boolean)

Creates a new options instance with the deterministic property set accordingly.

WithGeneralDiagnosticOption(ReportDiagnostic)

Creates a new options instance with the specified general diagnostic option.

WithMainTypeName(String)
WithMetadataImportOptions(MetadataImportOptions)
WithMetadataReferenceResolver(MetadataReferenceResolver)
WithModuleName(String)
WithOptimizationLevel(OptimizationLevel)

Creates a new options instance with optimizations enabled or disabled.

WithOutputKind(OutputKind)

Creates a new options instance with the specified output kind.

WithOverflowChecks(Boolean)
WithPlatform(Platform)

Creates a new options instance with the specified platform.

WithPublicSign(Boolean)

Creates a new options instance with the specified public sign setting.

WithReportSuppressedDiagnostics(Boolean)

Creates a new options instance with the specified suppressed diagnostics reporting option.

WithScriptClassName(String)
WithSourceReferenceResolver(SourceReferenceResolver)
WithSpecificDiagnosticOptions(IEnumerable<KeyValuePair<String,ReportDiagnostic>>)

Creates a new options instance with the specified diagnostic-specific options.

WithSpecificDiagnosticOptions(ImmutableDictionary<String,ReportDiagnostic>)

Creates a new options instance with the specified diagnostic-specific options.

WithStrongNameProvider(StrongNameProvider)
WithSyntaxTreeOptionsProvider(SyntaxTreeOptionsProvider)
WithXmlReferenceResolver(XmlReferenceResolver)

Operators

Equality(CompilationOptions, CompilationOptions)
Inequality(CompilationOptions, CompilationOptions)

Applies to