Click or drag to resize

CSharpCompilationOptions Class



Represents various options that affect compilation, such as whether to emit an executable or a library, whether to optimize generated code, and so on.
Inheritance Hierarchy
SystemObject
  Microsoft.CodeAnalysisCompilationOptions
    Microsoft.CodeAnalysis.CSharpCSharpCompilationOptions

Namespace:  Microsoft.CodeAnalysis.CSharp
Assembly:  Microsoft.CodeAnalysis.CSharp (in Microsoft.CodeAnalysis.CSharp.dll) Version: 2.3.0-dev-56735-00. Commit Hash: <developer build>
Syntax
public sealed class CSharpCompilationOptions : CompilationOptions, 
	IEquatable

The CSharpCompilationOptions type exposes the following members.

Constructors
  NameDescription
Public methodCSharpCompilationOptions(OutputKind, String, String, String, IEnumerableT, Void, String, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArrayByte, NullableT, Void, Boolean, Platform, ReportDiagnostic, Int32, IEnumerableT, Void, KeyValuePairTKey, TValue)
Initializes a new instance of the CSharpCompilationOptions class
Public methodCSharpCompilationOptions(OutputKind, String, String, String, IEnumerableT, Void, String, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArrayByte, NullableT, Void, Boolean, Platform, ReportDiagnostic, Int32, IEnumerableT, Void, KeyValuePairTKey, TValue, Boolean)
Initializes a new instance of the CSharpCompilationOptions class
Public methodCSharpCompilationOptions(OutputKind, Boolean, String, String, String, IEnumerableT, Void, String, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArrayByte, NullableT, Void, Boolean, Platform, ReportDiagnostic, Int32, IEnumerableT, Void, KeyValuePairTKey, TValue, Boolean)
Initializes a new instance of the CSharpCompilationOptions class
Public methodCSharpCompilationOptions(OutputKind, Boolean, String, String, String, IEnumerableT, Void, String, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArrayByte, NullableT, Void, Boolean, Platform, ReportDiagnostic, Int32, IEnumerableT, Void, KeyValuePairTKey, TValue, Boolean, String)
Initializes a new instance of the CSharpCompilationOptions class
Top
Properties
  NameDescription
Public propertyAllowUnsafe
Allow unsafe regions (i.e. unsafe modifiers on members and unsafe blocks).
Public propertyAssemblyIdentityComparer
Used to compare assembly identities. May implement unification and portability policies specific to the target platform. Default if not specified.
(Inherited from CompilationOptions.)
Public propertyCheckOverflow
Whether bounds checking on integer arithmetic is enforced by default or not.
(Inherited from CompilationOptions.)
Public propertyConcurrentBuild
Specifies whether building compilation may use multiple threads.
(Inherited from CompilationOptions.)
Public propertyCryptoKeyContainer
The CSP container containing the key with which to sign the output.
(Inherited from CompilationOptions.)
Public propertyCryptoKeyFile
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.
(Inherited from CompilationOptions.)
Public propertyCryptoPublicKey
Specifies public key used to generate strong name for the compilation assembly, or empty if not specified.
(Inherited from CompilationOptions.)
Public propertyDelaySign
Mark the compilation assembly as delay-signed.
(Inherited from CompilationOptions.)
Public propertyDeterministic
Specifies whether the compilation should be deterministic.
(Inherited from CompilationOptions.)
Public propertyErrors
Errors collection related to an incompatible set of compilation options
(Inherited from CompilationOptions.)
Public propertyGeneralDiagnosticOption
Global warning report option
(Inherited from CompilationOptions.)
Public propertyLanguage (Overrides CompilationOptionsLanguage.)
Public propertyMainTypeName
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.
(Inherited from CompilationOptions.)
Public propertyMetadataReferenceResolver
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).
(Inherited from CompilationOptions.)
Public propertyModuleName
Name of the primary module, or null if a default name should be used.
(Inherited from CompilationOptions.)
Public propertyOptimizationLevel
Specifies whether or not optimizations should be performed on the output IL. This is independent of whether or not PDB information is generated.
(Inherited from CompilationOptions.)
Public propertyOutputKind
The kind of assembly generated when emitted.
(Inherited from CompilationOptions.)
Public propertyPlatform
Specifies which version of the common language runtime (CLR) can run the assembly.
(Inherited from CompilationOptions.)
Public propertyPublicSign
Mark the compilation assembly as fully signed, but only sign with the public key.
(Inherited from CompilationOptions.)
Public propertyReportSuppressedDiagnostics
Whether diagnostics suppressed in source, i.e. IsSuppressed is true, should be reported.
(Inherited from CompilationOptions.)
Public propertyScriptClassName
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.
(Inherited from CompilationOptions.)
Public propertySourceReferenceResolver
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.
(Inherited from CompilationOptions.)
Public propertySpecificDiagnosticOptions
Warning report option for each warning.
(Inherited from CompilationOptions.)
Public propertyStrongNameProvider
Provides strong name and signature the source assembly. Null if assembly signing is not supported.
(Inherited from CompilationOptions.)
Public propertyUsings
Global namespace usings.
Public propertyWarningLevel
Global warning level (from 0 to 4).
(Inherited from CompilationOptions.)
Public propertyXmlReferenceResolver
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.
(Inherited from CompilationOptions.)
Top
Methods
  NameDescription
Public methodEquals(Object) (Overrides CompilationOptionsEquals(Object).)
Public methodEquals(CSharpCompilationOptions)
Public methodGetHashCode (Overrides CompilationOptionsGetHashCode.)
Public methodWithAllowUnsafe
Public methodWithAssemblyIdentityComparer
Public methodWithConcurrentBuild
Public methodWithCryptoKeyContainer
Public methodWithCryptoKeyFile
Public methodWithCryptoPublicKey(ImmutableArrayByte) (Inherited from CompilationOptions.)
Public methodWithCryptoPublicKey(ImmutableArrayByte)
Public methodWithDelaySign(NullableT) (Inherited from CompilationOptions.)
Public methodWithDelaySign(NullableT)
Public methodWithDeterministic
Public methodWithGeneralDiagnosticOption
Public methodWithMainTypeName
Public methodWithMetadataReferenceResolver
Public methodWithModuleName
Public methodWithOptimizationLevel
Public methodWithOutputKind
Public methodWithOverflowChecks
Public methodWithPlatform
Public methodWithPublicSign
Public methodWithReportSuppressedDiagnostics
Public methodWithScriptClassName
Public methodWithSourceReferenceResolver
Public methodWithSpecificDiagnosticOptions(IEnumerableT) (Inherited from CompilationOptions.)
Public methodWithSpecificDiagnosticOptions(ImmutableDictionaryString, ReportDiagnostic)
Creates a new options instance with the specified diagnostic-specific options.
(Inherited from CompilationOptions.)
Public methodWithSpecificDiagnosticOptions(IEnumerableT)
Public methodWithSpecificDiagnosticOptions(ImmutableDictionaryString, ReportDiagnostic)
Public methodWithStrongNameProvider
Public methodWithUsings(IEnumerableT)
Public methodWithUsings(ImmutableArrayString)
Public methodWithUsings(String)
Public methodWithWarningLevel
Public methodWithXmlReferenceResolver
Top
See Also