Compartir a través de


CSharpCompilationOptions Class

Definition

Represents various options that affect compilation, such as whether to emit an executable or a library, whether to optimize generated code, and so on.

public ref class CSharpCompilationOptions sealed : Microsoft::CodeAnalysis::CompilationOptions, IEquatable<Microsoft::CodeAnalysis::CSharp::CSharpCompilationOptions ^>
public sealed class CSharpCompilationOptions : Microsoft.CodeAnalysis.CompilationOptions, IEquatable<Microsoft.CodeAnalysis.CSharp.CSharpCompilationOptions>
type CSharpCompilationOptions = class
    inherit CompilationOptions
    interface IEquatable<CSharpCompilationOptions>
Public NotInheritable Class CSharpCompilationOptions
Inherits CompilationOptions
Implements IEquatable(Of CSharpCompilationOptions)
Inheritance
CSharpCompilationOptions
Implements

Constructors

CSharpCompilationOptions(OutputKind, Boolean, String, String, String, IEnumerable<String>, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArray<Byte>, Nullable<Boolean>, Platform, ReportDiagnostic, Int32, IEnumerable<KeyValuePair<String,ReportDiagnostic>>, Boolean, Boolean, XmlReferenceResolver, SourceReferenceResolver, MetadataReferenceResolver, AssemblyIdentityComparer, StrongNameProvider, Boolean, MetadataImportOptions, NullableContextOptions)
CSharpCompilationOptions(OutputKind, Boolean, String, String, String, IEnumerable<String>, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArray<Byte>, Nullable<Boolean>, Platform, ReportDiagnostic, Int32, IEnumerable<KeyValuePair<String,ReportDiagnostic>>, Boolean, Boolean, XmlReferenceResolver, SourceReferenceResolver, MetadataReferenceResolver, AssemblyIdentityComparer, StrongNameProvider, Boolean, MetadataImportOptions, NullableContextOptions)
CSharpCompilationOptions(OutputKind, Boolean, String, String, String, IEnumerable<String>, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArray<Byte>, Nullable<Boolean>, Platform, ReportDiagnostic, Int32, IEnumerable<KeyValuePair<String,ReportDiagnostic>>, Boolean, Boolean, XmlReferenceResolver, SourceReferenceResolver, MetadataReferenceResolver, AssemblyIdentityComparer, StrongNameProvider, Boolean, MetadataImportOptions)
CSharpCompilationOptions(OutputKind, Boolean, String, String, String, IEnumerable<String>, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArray<Byte>, Nullable<Boolean>, Platform, ReportDiagnostic, Int32, IEnumerable<KeyValuePair<String,ReportDiagnostic>>, Boolean, Boolean, XmlReferenceResolver, SourceReferenceResolver, MetadataReferenceResolver, AssemblyIdentityComparer, StrongNameProvider, Boolean)
CSharpCompilationOptions(OutputKind, Boolean, String, String, String, IEnumerable<String>, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArray<Byte>, Nullable<Boolean>, Platform, ReportDiagnostic, Int32, IEnumerable<KeyValuePair<String,ReportDiagnostic>>, Boolean, Boolean, XmlReferenceResolver, SourceReferenceResolver, MetadataReferenceResolver, AssemblyIdentityComparer, StrongNameProvider)
CSharpCompilationOptions(OutputKind, String, String, String, IEnumerable<String>, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArray<Byte>, Nullable<Boolean>, Platform, ReportDiagnostic, Int32, IEnumerable<KeyValuePair<String, ReportDiagnostic>>, Boolean, Boolean, XmlReferenceResolver, SourceReferenceResolver, MetadataReferenceResolver, AssemblyIdentityComparer, StrongNameProvider)
CSharpCompilationOptions(OutputKind, String, String, String, IEnumerable<String>, OptimizationLevel, Boolean, Boolean, String, String, ImmutableArray<Byte>, Nullable<Boolean>, Platform, ReportDiagnostic, Int32, IEnumerable<KeyValuePair<String, ReportDiagnostic>>, Boolean, XmlReferenceResolver, SourceReferenceResolver, MetadataReferenceResolver, AssemblyIdentityComparer, StrongNameProvider)

Properties

AllowUnsafe

Allow unsafe regions (i.e. unsafe modifiers on members and unsafe blocks).

AssemblyIdentityComparer

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

(Inherited from CompilationOptions)
CheckOverflow

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

(Inherited from CompilationOptions)
ConcurrentBuild

Specifies whether building compilation may use multiple threads.

(Inherited from CompilationOptions)
CryptoKeyContainer

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

(Inherited from CompilationOptions)
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.

(Inherited from CompilationOptions)
CryptoPublicKey

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

(Inherited from CompilationOptions)
DelaySign

Mark the compilation assembly as delay-signed.

(Inherited from CompilationOptions)
Deterministic

Specifies whether the compilation should be deterministic.

(Inherited from CompilationOptions)
Errors

Errors collection related to an incompatible set of compilation options

(Inherited from CompilationOptions)
Features
Obsolete.

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

(Inherited from CompilationOptions)
GeneralDiagnosticOption

Global warning report option

(Inherited from CompilationOptions)
Language
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.

(Inherited from CompilationOptions)
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.

(Inherited from CompilationOptions)
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).

(Inherited from CompilationOptions)
ModuleName

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

(Inherited from CompilationOptions)
NullableContextOptions

Global Nullable context options.

OptimizationLevel

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)
OutputKind

The kind of assembly generated when emitted.

(Inherited from CompilationOptions)
Platform

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

(Inherited from CompilationOptions)
PublicSign

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

(Inherited from CompilationOptions)
ReportSuppressedDiagnostics

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

(Inherited from CompilationOptions)
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.

(Inherited from CompilationOptions)
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.

(Inherited from CompilationOptions)
SpecificDiagnosticOptions

Warning report option for each warning.

(Inherited from CompilationOptions)
StrongNameProvider

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

(Inherited from CompilationOptions)
SyntaxTreeOptionsProvider

Provider to retrieve options for particular syntax trees.

(Inherited from CompilationOptions)
Usings

Global namespace usings.

WarningLevel

Global warning level (a non-negative integer).

(Inherited from CompilationOptions)
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.

(Inherited from CompilationOptions)

Methods

CommonWithAssemblyIdentityComparer(AssemblyIdentityComparer) (Inherited from CompilationOptions)
CommonWithCheckOverflow(Boolean) (Inherited from CompilationOptions)
CommonWithConcurrentBuild(Boolean) (Inherited from CompilationOptions)
CommonWithCryptoKeyContainer(String) (Inherited from CompilationOptions)
CommonWithCryptoKeyFile(String) (Inherited from CompilationOptions)
CommonWithCryptoPublicKey(ImmutableArray<Byte>) (Inherited from CompilationOptions)
CommonWithDelaySign(Nullable<Boolean>) (Inherited from CompilationOptions)
CommonWithDeterministic(Boolean) (Inherited from CompilationOptions)
CommonWithFeatures(ImmutableArray<String>)
Obsolete.
(Inherited from CompilationOptions)
CommonWithGeneralDiagnosticOption(ReportDiagnostic) (Inherited from CompilationOptions)
CommonWithMainTypeName(String) (Inherited from CompilationOptions)
CommonWithMetadataImportOptions(MetadataImportOptions) (Inherited from CompilationOptions)
CommonWithMetadataReferenceResolver(MetadataReferenceResolver) (Inherited from CompilationOptions)
CommonWithModuleName(String) (Inherited from CompilationOptions)
CommonWithOptimizationLevel(OptimizationLevel) (Inherited from CompilationOptions)
CommonWithOutputKind(OutputKind) (Inherited from CompilationOptions)
CommonWithPlatform(Platform) (Inherited from CompilationOptions)
CommonWithPublicSign(Boolean) (Inherited from CompilationOptions)
CommonWithReportSuppressedDiagnostics(Boolean) (Inherited from CompilationOptions)
CommonWithScriptClassName(String) (Inherited from CompilationOptions)
CommonWithSourceReferenceResolver(SourceReferenceResolver) (Inherited from CompilationOptions)
CommonWithSpecificDiagnosticOptions(IEnumerable<KeyValuePair<String,ReportDiagnostic>>) (Inherited from CompilationOptions)
CommonWithSpecificDiagnosticOptions(ImmutableDictionary<String,ReportDiagnostic>) (Inherited from CompilationOptions)
CommonWithStrongNameProvider(StrongNameProvider) (Inherited from CompilationOptions)
CommonWithSyntaxTreeOptionsProvider(SyntaxTreeOptionsProvider) (Inherited from CompilationOptions)
CommonWithXmlReferenceResolver(XmlReferenceResolver) (Inherited from CompilationOptions)
ComputeHashCode() (Inherited from CompilationOptions)
Equals(CSharpCompilationOptions)
Equals(Object)
EqualsHelper(CompilationOptions) (Inherited from CompilationOptions)
GetHashCode()
GetHashCode() (Inherited from CompilationOptions)
GetHashCodeHelper() (Inherited from CompilationOptions)
WithAllowUnsafe(Boolean)
WithAssemblyIdentityComparer(AssemblyIdentityComparer)
WithConcurrentBuild(Boolean)
WithCryptoKeyContainer(String)
WithCryptoKeyFile(String)
WithCryptoPublicKey(ImmutableArray<Byte>)
WithDelaySign(Nullable<Boolean>)
WithDeterministic(Boolean)
WithGeneralDiagnosticOption(ReportDiagnostic)
WithMainTypeName(String)
WithMetadataImportOptions(MetadataImportOptions)
WithMetadataReferenceResolver(MetadataReferenceResolver)
WithModuleName(String)
WithNullableContextOptions(NullableContextOptions)
WithNullableContextOptions(NullableContextOptions)
WithOptimizationLevel(OptimizationLevel)
WithOutputKind(OutputKind)
WithOverflowChecks(Boolean)
WithPlatform(Platform)
WithPublicSign(Boolean)
WithReportSuppressedDiagnostics(Boolean)
WithScriptClassName(String)
WithSourceReferenceResolver(SourceReferenceResolver)
WithSpecificDiagnosticOptions(IEnumerable<KeyValuePair<String,ReportDiagnostic>>)
WithSpecificDiagnosticOptions(ImmutableDictionary<String,ReportDiagnostic>)
WithStrongNameProvider(StrongNameProvider)
WithSyntaxTreeOptionsProvider(SyntaxTreeOptionsProvider)
WithSyntaxTreeOptionsProvider(SyntaxTreeOptionsProvider) (Inherited from CompilationOptions)
WithUsings(IEnumerable<String>)
WithUsings(ImmutableArray<String>)
WithUsings(String[])
WithWarningLevel(Int32)
WithXmlReferenceResolver(XmlReferenceResolver)

Applies to