Compilation Compilation Compilation Compilation Class

Definition

The compilation object is an immutable representation of a single invocation of the compiler. Although immutable, a compilation is also on-demand, and will realize and cache data as necessary. A compilation can produce a new compilation from existing compilation with the application of small deltas. In many cases, it is more efficient than creating a new compilation from scratch, as the new compilation can reuse information from the old compilation.

public ref class Compilation abstract
public abstract class Compilation
type Compilation = class
Public MustInherit Class Compilation
Inheritance
CompilationCompilationCompilationCompilation
Derived

Fields

_features _features _features _features

Properties

Assembly Assembly Assembly Assembly

The IAssemblySymbol that represents the assembly being created.

AssemblyName AssemblyName AssemblyName AssemblyName

Simple assembly name, or null if not specified.

CommonAssembly CommonAssembly CommonAssembly CommonAssembly
CommonDynamicType CommonDynamicType CommonDynamicType CommonDynamicType
CommonGlobalNamespace CommonGlobalNamespace CommonGlobalNamespace CommonGlobalNamespace
CommonObjectType CommonObjectType CommonObjectType CommonObjectType
CommonOptions CommonOptions CommonOptions CommonOptions
CommonScriptClass CommonScriptClass CommonScriptClass CommonScriptClass
CommonSourceModule CommonSourceModule CommonSourceModule CommonSourceModule
CommonSyntaxTrees CommonSyntaxTrees CommonSyntaxTrees CommonSyntaxTrees
DirectiveReferences DirectiveReferences DirectiveReferences DirectiveReferences

Unique metadata references specified via #r directive in the source code of this compilation.

DynamicType DynamicType DynamicType DynamicType

The TypeSymbol for the type 'dynamic' in this Compilation.

ExternalReferences ExternalReferences ExternalReferences ExternalReferences

Metadata references passed to the compilation constructor.

GlobalNamespace GlobalNamespace GlobalNamespace GlobalNamespace

The root namespace that contains all namespaces and types defined in source code or in referenced metadata, merged into a single namespace hierarchy.

IsCaseSensitive IsCaseSensitive IsCaseSensitive IsCaseSensitive

Returns true if this is a case sensitive compilation, false otherwise. Case sensitivity affects compilation features such as name lookup as well as choosing what names to emit when there are multiple different choices (for example between a virtual method and an override).

Language Language Language Language

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

ObjectType ObjectType ObjectType ObjectType

The INamedTypeSymbol for the .NET System.Object type, which could have a TypeKind of Error if there was no COR Library in this Compilation.

Options Options Options Options

Gets the options the compilation was created with.

ReferencedAssemblyNames ReferencedAssemblyNames ReferencedAssemblyNames ReferencedAssemblyNames

Assembly identities of all assemblies directly referenced by this compilation.

References References References References

All metadata references -- references passed to the compilation constructor as well as references specified via #r directives.

ScriptClass ScriptClass ScriptClass ScriptClass

A symbol representing the implicit Script class. This is null if the class is not defined in the compilation.

ScriptCompilationInfo ScriptCompilationInfo ScriptCompilationInfo ScriptCompilationInfo
SourceModule SourceModule SourceModule SourceModule

Gets the IModuleSymbol for the module being created by compiling all of the source code.

SyntaxTrees SyntaxTrees SyntaxTrees SyntaxTrees

Gets the syntax trees (parsed from source code) that this compilation was created with.

Methods

AddReferences(MetadataReference[]) AddReferences(MetadataReference[]) AddReferences(MetadataReference[]) AddReferences(MetadataReference[])

Creates a new compilation with additional metadata references.

AddReferences(IEnumerable<MetadataReference>) AddReferences(IEnumerable<MetadataReference>) AddReferences(IEnumerable<MetadataReference>) AddReferences(IEnumerable<MetadataReference>)

Creates a new compilation with additional metadata references.

AddSyntaxTrees(SyntaxTree[]) AddSyntaxTrees(SyntaxTree[]) AddSyntaxTrees(SyntaxTree[]) AddSyntaxTrees(SyntaxTree[])

Creates a new compilation with additional syntax trees.

AddSyntaxTrees(IEnumerable<SyntaxTree>) AddSyntaxTrees(IEnumerable<SyntaxTree>) AddSyntaxTrees(IEnumerable<SyntaxTree>) AddSyntaxTrees(IEnumerable<SyntaxTree>)

Creates a new compilation with additional syntax trees.

AppendDefaultVersionResource(Stream) AppendDefaultVersionResource(Stream) AppendDefaultVersionResource(Stream) AppendDefaultVersionResource(Stream)
CheckTupleElementLocations(Int32, ImmutableArray<Location>) CheckTupleElementLocations(Int32, ImmutableArray<Location>) CheckTupleElementLocations(Int32, ImmutableArray<Location>) CheckTupleElementLocations(Int32, ImmutableArray<Location>)
CheckTupleElementNames(Int32, ImmutableArray<String>) CheckTupleElementNames(Int32, ImmutableArray<String>) CheckTupleElementNames(Int32, ImmutableArray<String>) CheckTupleElementNames(Int32, ImmutableArray<String>)

Check that if any names are provided, and their number matches the expected cardinality. Returns a normalized version of the element names (empty array if all the names are null).

ClassifyCommonConversion(ITypeSymbol, ITypeSymbol) ClassifyCommonConversion(ITypeSymbol, ITypeSymbol) ClassifyCommonConversion(ITypeSymbol, ITypeSymbol) ClassifyCommonConversion(ITypeSymbol, ITypeSymbol)

Classifies a conversion from source to destination according to this compilation's programming language.

Clone() Clone() Clone() Clone()

Creates a new compilation equivalent to this one with different symbol instances.

CommonAddSyntaxTrees(IEnumerable<SyntaxTree>) CommonAddSyntaxTrees(IEnumerable<SyntaxTree>) CommonAddSyntaxTrees(IEnumerable<SyntaxTree>) CommonAddSyntaxTrees(IEnumerable<SyntaxTree>)
CommonBindScriptClass() CommonBindScriptClass() CommonBindScriptClass() CommonBindScriptClass()

Resolves a symbol that represents script container (Script class). Uses the full name of the container class stored in ScriptClassName to find the symbol.

CommonClone() CommonClone() CommonClone() CommonClone()
CommonContainsSyntaxTree(SyntaxTree) CommonContainsSyntaxTree(SyntaxTree) CommonContainsSyntaxTree(SyntaxTree) CommonContainsSyntaxTree(SyntaxTree)
CommonCreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>, ImmutableArray<Boolean>) CommonCreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>, ImmutableArray<Boolean>) CommonCreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>, ImmutableArray<Boolean>) CommonCreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>, ImmutableArray<Boolean>)
CommonCreateArrayTypeSymbol(ITypeSymbol, Int32) CommonCreateArrayTypeSymbol(ITypeSymbol, Int32) CommonCreateArrayTypeSymbol(ITypeSymbol, Int32) CommonCreateArrayTypeSymbol(ITypeSymbol, Int32)
CommonCreateErrorNamespaceSymbol(INamespaceSymbol, String) CommonCreateErrorNamespaceSymbol(INamespaceSymbol, String) CommonCreateErrorNamespaceSymbol(INamespaceSymbol, String) CommonCreateErrorNamespaceSymbol(INamespaceSymbol, String)
CommonCreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32) CommonCreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32) CommonCreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32) CommonCreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32)
CommonCreatePointerTypeSymbol(ITypeSymbol) CommonCreatePointerTypeSymbol(ITypeSymbol) CommonCreatePointerTypeSymbol(ITypeSymbol) CommonCreatePointerTypeSymbol(ITypeSymbol)
CommonCreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>) CommonCreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>) CommonCreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>) CommonCreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>)
CommonCreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>) CommonCreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>) CommonCreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>) CommonCreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>)
CommonGetAssemblyOrModuleSymbol(MetadataReference) CommonGetAssemblyOrModuleSymbol(MetadataReference) CommonGetAssemblyOrModuleSymbol(MetadataReference) CommonGetAssemblyOrModuleSymbol(MetadataReference)
CommonGetCompilationNamespace(INamespaceSymbol) CommonGetCompilationNamespace(INamespaceSymbol) CommonGetCompilationNamespace(INamespaceSymbol) CommonGetCompilationNamespace(INamespaceSymbol)
CommonGetEntryPoint(CancellationToken) CommonGetEntryPoint(CancellationToken) CommonGetEntryPoint(CancellationToken) CommonGetEntryPoint(CancellationToken)
CommonGetSemanticModel(SyntaxTree, Boolean) CommonGetSemanticModel(SyntaxTree, Boolean) CommonGetSemanticModel(SyntaxTree, Boolean) CommonGetSemanticModel(SyntaxTree, Boolean)
CommonGetSpecialType(SpecialType) CommonGetSpecialType(SpecialType) CommonGetSpecialType(SpecialType) CommonGetSpecialType(SpecialType)
CommonGetTypeByMetadataName(String) CommonGetTypeByMetadataName(String) CommonGetTypeByMetadataName(String) CommonGetTypeByMetadataName(String)
CommonRemoveAllSyntaxTrees() CommonRemoveAllSyntaxTrees() CommonRemoveAllSyntaxTrees() CommonRemoveAllSyntaxTrees()
CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree>) CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree>) CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree>) CommonRemoveSyntaxTrees(IEnumerable<SyntaxTree>)
CommonReplaceSyntaxTree(SyntaxTree, SyntaxTree) CommonReplaceSyntaxTree(SyntaxTree, SyntaxTree) CommonReplaceSyntaxTree(SyntaxTree, SyntaxTree) CommonReplaceSyntaxTree(SyntaxTree, SyntaxTree)
CommonWithAssemblyName(String) CommonWithAssemblyName(String) CommonWithAssemblyName(String) CommonWithAssemblyName(String)
CommonWithOptions(CompilationOptions) CommonWithOptions(CompilationOptions) CommonWithOptions(CompilationOptions) CommonWithOptions(CompilationOptions)
CommonWithReferences(IEnumerable<MetadataReference>) CommonWithReferences(IEnumerable<MetadataReference>) CommonWithReferences(IEnumerable<MetadataReference>) CommonWithReferences(IEnumerable<MetadataReference>)

Creates a new compilation with the specified references.

CommonWithScriptCompilationInfo(ScriptCompilationInfo) CommonWithScriptCompilationInfo(ScriptCompilationInfo) CommonWithScriptCompilationInfo(ScriptCompilationInfo) CommonWithScriptCompilationInfo(ScriptCompilationInfo)
ContainsSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) ContainsSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) ContainsSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) ContainsSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken)

Return true if there is a source declaration symbol name that meets given predicate.

ContainsSymbolsWithName(String, SymbolFilter, CancellationToken) ContainsSymbolsWithName(String, SymbolFilter, CancellationToken) ContainsSymbolsWithName(String, SymbolFilter, CancellationToken) ContainsSymbolsWithName(String, SymbolFilter, CancellationToken)

Return true if there is a source declaration symbol name that matches the provided name. This may be faster than ContainsSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) when predicate is just a simple string check. name is case sensitive or not depending on the target language.

ContainsSyntaxTree(SyntaxTree) ContainsSyntaxTree(SyntaxTree) ContainsSyntaxTree(SyntaxTree) ContainsSyntaxTree(SyntaxTree)

Returns true if this compilation contains the specified tree. False otherwise.

CreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Boolean>, ImmutableArray<Location>) CreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Boolean>, ImmutableArray<Location>) CreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Boolean>, ImmutableArray<Location>) CreateAnonymousTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Boolean>, ImmutableArray<Location>)

Returns a new anonymous type symbol with the given member types member names. Anonymous type members will be readonly by default. Writable properties are supported in VB and can be created by passing in false in the appropriate locations in memberIsReadOnly.

Source locations can also be provided through memberLocations

CreateArrayTypeSymbol(ITypeSymbol, Int32) CreateArrayTypeSymbol(ITypeSymbol, Int32) CreateArrayTypeSymbol(ITypeSymbol, Int32) CreateArrayTypeSymbol(ITypeSymbol, Int32)

Returns a new ArrayTypeSymbol representing an array type tied to the base types of the COR Library in this Compilation.

CreateDefaultWin32Resources(Boolean, Boolean, Stream, Stream) CreateDefaultWin32Resources(Boolean, Boolean, Stream, Stream) CreateDefaultWin32Resources(Boolean, Boolean, Stream, Stream) CreateDefaultWin32Resources(Boolean, Boolean, Stream, Stream)

Create a stream filled with default win32 resources.

CreateErrorNamespaceSymbol(INamespaceSymbol, String) CreateErrorNamespaceSymbol(INamespaceSymbol, String) CreateErrorNamespaceSymbol(INamespaceSymbol, String) CreateErrorNamespaceSymbol(INamespaceSymbol, String)

Returns a new INamespaceSymbol representing an error (missing) namespace with the given name.

CreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32) CreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32) CreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32) CreateErrorTypeSymbol(INamespaceOrTypeSymbol, String, Int32)

Returns a new INamedTypeSymbol representing an error type with the given name and arity in the given optional container.

CreatePointerTypeSymbol(ITypeSymbol) CreatePointerTypeSymbol(ITypeSymbol) CreatePointerTypeSymbol(ITypeSymbol) CreatePointerTypeSymbol(ITypeSymbol)

Returns a new PointerTypeSymbol representing a pointer type tied to a type in this Compilation.

CreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>) CreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>) CreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>) CreateTupleTypeSymbol(ImmutableArray<ITypeSymbol>, ImmutableArray<String>, ImmutableArray<Location>)

Returns a new INamedTypeSymbol with the given element types and (optional) element names.

CreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>) CreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>) CreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>) CreateTupleTypeSymbol(INamedTypeSymbol, ImmutableArray<String>, ImmutableArray<Location>)

Returns a new INamedTypeSymbol with the given underlying type and (optional) element names.

Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, CancellationToken)
Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, CancellationToken)
Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, CancellationToken)
Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, Stream, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, Stream, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, Stream, CancellationToken) Emit(Stream, Stream, Stream, Stream, IEnumerable<ResourceDescription>, EmitOptions, IMethodSymbol, Stream, IEnumerable<EmbeddedText>, Stream, CancellationToken)

Emit the IL for the compiled source code into the specified stream.

EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken) EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken) EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken) EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken)

Emit the differences between the compilation and the previous generation for Edit and Continue. The differences are expressed as added and changed symbols, and are emitted as metadata, IL, and PDB deltas. A representation of the current compilation is returned as an EmitBaseline for use in a subsequent Edit and Continue.

EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Func<ISymbol,Boolean>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken) EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Func<ISymbol,Boolean>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken) EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Func<ISymbol,Boolean>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken) EmitDifference(EmitBaseline, IEnumerable<SemanticEdit>, Func<ISymbol,Boolean>, Stream, Stream, Stream, ICollection<MethodDefinitionHandle>, CancellationToken)

Emit the differences between the compilation and the previous generation for Edit and Continue. The differences are expressed as added and changed symbols, and are emitted as metadata, IL, and PDB deltas. A representation of the current compilation is returned as an EmitBaseline for use in a subsequent Edit and Continue.

GetAssemblyOrModuleSymbol(MetadataReference) GetAssemblyOrModuleSymbol(MetadataReference) GetAssemblyOrModuleSymbol(MetadataReference) GetAssemblyOrModuleSymbol(MetadataReference)

Gets the IAssemblySymbol or IModuleSymbol for a metadata reference used to create this compilation.

GetCompilationNamespace(INamespaceSymbol) GetCompilationNamespace(INamespaceSymbol) GetCompilationNamespace(INamespaceSymbol) GetCompilationNamespace(INamespaceSymbol)

Gets the corresponding compilation namespace for the specified module or assembly namespace.

GetDeclarationDiagnostics(CancellationToken) GetDeclarationDiagnostics(CancellationToken) GetDeclarationDiagnostics(CancellationToken) GetDeclarationDiagnostics(CancellationToken)

Gets the diagnostics produced during symbol declaration.

GetDiagnostics(CancellationToken) GetDiagnostics(CancellationToken) GetDiagnostics(CancellationToken) GetDiagnostics(CancellationToken)

Gets all the diagnostics for the compilation, including syntax, declaration, and binding. Does not include any diagnostics that might be produced during emit, see EmitResult.

GetEntryPoint(CancellationToken) GetEntryPoint(CancellationToken) GetEntryPoint(CancellationToken) GetEntryPoint(CancellationToken)

Returns the Main method that will serves as the entry point of the assembly, if it is executable (and not a script).

GetMetadataReference(IAssemblySymbol) GetMetadataReference(IAssemblySymbol) GetMetadataReference(IAssemblySymbol) GetMetadataReference(IAssemblySymbol)

Gets the MetadataReference that corresponds to the assembly symbol.

GetMethodBodyDiagnostics(CancellationToken) GetMethodBodyDiagnostics(CancellationToken) GetMethodBodyDiagnostics(CancellationToken) GetMethodBodyDiagnostics(CancellationToken)

Gets the diagnostics produced during the analysis of method bodies and field initializers.

GetParseDiagnostics(CancellationToken) GetParseDiagnostics(CancellationToken) GetParseDiagnostics(CancellationToken) GetParseDiagnostics(CancellationToken)

Gets the diagnostics produced during the parsing stage.

GetRequiredLanguageVersion(Diagnostic) GetRequiredLanguageVersion(Diagnostic) GetRequiredLanguageVersion(Diagnostic) GetRequiredLanguageVersion(Diagnostic)

Returns the required language version found in a Diagnostic, if any is found. Returns null if none is found.

GetSemanticModel(SyntaxTree, Boolean) GetSemanticModel(SyntaxTree, Boolean) GetSemanticModel(SyntaxTree, Boolean) GetSemanticModel(SyntaxTree, Boolean)

Gets a new SemanticModel for the specified syntax tree.

GetSpecialType(SpecialType) GetSpecialType(SpecialType) GetSpecialType(SpecialType) GetSpecialType(SpecialType)

Get the symbol for the predefined type from the Cor Library referenced by this compilation.

GetSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) GetSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) GetSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) GetSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken)

Return source declaration symbols whose name meets given predicate.

GetSymbolsWithName(String, SymbolFilter, CancellationToken) GetSymbolsWithName(String, SymbolFilter, CancellationToken) GetSymbolsWithName(String, SymbolFilter, CancellationToken) GetSymbolsWithName(String, SymbolFilter, CancellationToken)

Return source declaration symbols whose name matches the provided name. This may be faster than GetSymbolsWithName(Func<String,Boolean>, SymbolFilter, CancellationToken) when predicate is just a simple string check. name is case sensitive or not depending on the target language.

GetTypeByMetadataName(String) GetTypeByMetadataName(String) GetTypeByMetadataName(String) GetTypeByMetadataName(String)

Gets the type within the compilation's assembly and all referenced assemblies (other than those that can only be referenced via an extern alias) using its canonical CLR metadata name.

GetUnreferencedAssemblyIdentities(Diagnostic) GetUnreferencedAssemblyIdentities(Diagnostic) GetUnreferencedAssemblyIdentities(Diagnostic) GetUnreferencedAssemblyIdentities(Diagnostic)

Given a Diagnostic reporting unreferenced AssemblyIdentitys, returns the actual AssemblyIdentity instances that were not referenced.

HasImplicitConversion(ITypeSymbol, ITypeSymbol) HasImplicitConversion(ITypeSymbol, ITypeSymbol) HasImplicitConversion(ITypeSymbol, ITypeSymbol) HasImplicitConversion(ITypeSymbol, ITypeSymbol)

Returns true if there is an implicit (C#) or widening (VB) conversion from fromType to toType. Returns false if either fromType or toType is null, or if no such conversion exists.

IsSymbolAccessibleWithin(ISymbol, ISymbol, ITypeSymbol) IsSymbolAccessibleWithin(ISymbol, ISymbol, ITypeSymbol) IsSymbolAccessibleWithin(ISymbol, ISymbol, ITypeSymbol) IsSymbolAccessibleWithin(ISymbol, ISymbol, ITypeSymbol)

Checks if symbol is accessible from within within. An optional qualifier of type throughType is used to resolve protected access for instance members. All symbols are required to be from this compilation or some assembly referenced (References) by this compilation. within is required to be an INamedTypeSymbol or IAssemblySymbol.

RemoveAllReferences() RemoveAllReferences() RemoveAllReferences() RemoveAllReferences()

Creates a new compilation without any metadata references.

RemoveAllSyntaxTrees() RemoveAllSyntaxTrees() RemoveAllSyntaxTrees() RemoveAllSyntaxTrees()

Creates a new compilation without any syntax trees. Preserves metadata info for use with trees added later.

RemoveReferences(MetadataReference[]) RemoveReferences(MetadataReference[]) RemoveReferences(MetadataReference[]) RemoveReferences(MetadataReference[])

Creates a new compilation without the specified metadata references.

RemoveReferences(IEnumerable<MetadataReference>) RemoveReferences(IEnumerable<MetadataReference>) RemoveReferences(IEnumerable<MetadataReference>) RemoveReferences(IEnumerable<MetadataReference>)

Creates a new compilation without the specified metadata references.

RemoveSyntaxTrees(IEnumerable<SyntaxTree>) RemoveSyntaxTrees(IEnumerable<SyntaxTree>) RemoveSyntaxTrees(IEnumerable<SyntaxTree>) RemoveSyntaxTrees(IEnumerable<SyntaxTree>)

Creates a new compilation without the specified syntax trees. Preserves metadata info for use with trees added later.

RemoveSyntaxTrees(SyntaxTree[]) RemoveSyntaxTrees(SyntaxTree[]) RemoveSyntaxTrees(SyntaxTree[]) RemoveSyntaxTrees(SyntaxTree[])

Creates a new compilation without the specified syntax trees. Preserves metadata info for use with trees added later.

ReplaceReference(MetadataReference, MetadataReference) ReplaceReference(MetadataReference, MetadataReference) ReplaceReference(MetadataReference, MetadataReference) ReplaceReference(MetadataReference, MetadataReference)

Creates a new compilation with an old metadata reference replaced with a new metadata reference.

ReplaceSyntaxTree(SyntaxTree, SyntaxTree) ReplaceSyntaxTree(SyntaxTree, SyntaxTree) ReplaceSyntaxTree(SyntaxTree, SyntaxTree) ReplaceSyntaxTree(SyntaxTree, SyntaxTree)

Creates a new compilation with an old syntax tree replaced with a new syntax tree. Reuses metadata from old compilation object.

SyntaxTreeCommonFeatures(IEnumerable<SyntaxTree>) SyntaxTreeCommonFeatures(IEnumerable<SyntaxTree>) SyntaxTreeCommonFeatures(IEnumerable<SyntaxTree>) SyntaxTreeCommonFeatures(IEnumerable<SyntaxTree>)
ToMetadataReference(ImmutableArray<String>, Boolean) ToMetadataReference(ImmutableArray<String>, Boolean) ToMetadataReference(ImmutableArray<String>, Boolean) ToMetadataReference(ImmutableArray<String>, Boolean)

Creates a metadata reference for this compilation.

WithAssemblyName(String) WithAssemblyName(String) WithAssemblyName(String) WithAssemblyName(String)

Creates a compilation with the specified assembly name.

WithOptions(CompilationOptions) WithOptions(CompilationOptions) WithOptions(CompilationOptions) WithOptions(CompilationOptions)

Creates a new compilation with the specified compilation options.

WithReferences(IEnumerable<MetadataReference>) WithReferences(IEnumerable<MetadataReference>) WithReferences(IEnumerable<MetadataReference>) WithReferences(IEnumerable<MetadataReference>)

Creates a new compilation with the specified references.

WithReferences(MetadataReference[]) WithReferences(MetadataReference[]) WithReferences(MetadataReference[]) WithReferences(MetadataReference[])

Creates a new compilation with the specified references.

WithScriptCompilationInfo(ScriptCompilationInfo) WithScriptCompilationInfo(ScriptCompilationInfo) WithScriptCompilationInfo(ScriptCompilationInfo) WithScriptCompilationInfo(ScriptCompilationInfo)

Extension Methods

ClassifyConversion(Compilation, ITypeSymbol, ITypeSymbol) ClassifyConversion(Compilation, ITypeSymbol, ITypeSymbol) ClassifyConversion(Compilation, ITypeSymbol, ITypeSymbol) ClassifyConversion(Compilation, ITypeSymbol, ITypeSymbol)
WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken) WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken) WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken) WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, AnalyzerOptions, CancellationToken)

Returns a new compilation with attached diagnostic analyzers.

WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions) WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions) WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions) WithAnalyzers(Compilation, ImmutableArray<DiagnosticAnalyzer>, CompilationWithAnalyzersOptions)

Returns a new compilation with attached diagnostic analyzers.

Emit(Compilation, String, String, String, String, IEnumerable<ResourceDescription>, CancellationToken) Emit(Compilation, String, String, String, String, IEnumerable<ResourceDescription>, CancellationToken) Emit(Compilation, String, String, String, String, IEnumerable<ResourceDescription>, CancellationToken) Emit(Compilation, String, String, String, String, IEnumerable<ResourceDescription>, CancellationToken)

Emit the IL for the compilation into the specified stream.

Applies to