Share via


AssemblyMetadata.GetReference Method

Definition

Creates a reference to the assembly metadata.

public Microsoft.CodeAnalysis.PortableExecutableReference GetReference (Microsoft.CodeAnalysis.DocumentationProvider documentation = default, System.Collections.Immutable.ImmutableArray<string> aliases = default, bool embedInteropTypes = false, string filePath = default, string display = default);
public Microsoft.CodeAnalysis.PortableExecutableReference GetReference (Microsoft.CodeAnalysis.DocumentationProvider? documentation = default, System.Collections.Immutable.ImmutableArray<string> aliases = default, bool embedInteropTypes = false, string? filePath = default, string? display = default);
member this.GetReference : Microsoft.CodeAnalysis.DocumentationProvider * System.Collections.Immutable.ImmutableArray<string> * bool * string * string -> Microsoft.CodeAnalysis.PortableExecutableReference
Public Function GetReference (Optional documentation As DocumentationProvider = Nothing, Optional aliases As ImmutableArray(Of String) = Nothing, Optional embedInteropTypes As Boolean = false, Optional filePath As String = Nothing, Optional display As String = Nothing) As PortableExecutableReference

Parameters

documentation
DocumentationProvider

Provider of XML documentation comments for the metadata symbols contained in the module.

aliases
ImmutableArray<String>

Aliases that can be used to refer to the assembly from source code (see "extern alias" directive in C#).

embedInteropTypes
Boolean

True to embed interop types from the referenced assembly to the referencing compilation. Must be false for a module.

filePath
String

Path describing the location of the metadata, or null if the metadata have no location.

display
String

Display string used in error messages to identity the reference.

Returns

A reference to the assembly metadata.

Applies to