Table of Contents

Class StrongAssemblyIdentity

Namespace
Microsoft.VisualStudio.Composition
Assembly
Microsoft.VisualStudio.Composition.dll

Metadata about a Assembly that is used to determine if two assemblies are equivalent.

public class StrongAssemblyIdentity : IEquatable<StrongAssemblyIdentity>
Inheritance
StrongAssemblyIdentity
Implements
Inherited Members

Constructors

StrongAssemblyIdentity(AssemblyName, Guid)

Initializes a new instance of the StrongAssemblyIdentity class.

public StrongAssemblyIdentity(AssemblyName name, Guid mvid)

Parameters

name AssemblyName

The assembly name. Cannot be null.

mvid Guid

The MVID of the ManifestModule of the assembly.

Properties

Mvid

Gets the MVID for the assembly's manifest module. This is a unique identifier that represents individual builds of an assembly.

public Guid Mvid { get; }

Property Value

Guid

Name

Gets the assembly's full name.

public AssemblyName Name { get; }

Property Value

AssemblyName

Methods

CreateFrom(Assembly, AssemblyName?)

Gets the metadata from an assembly.

public static StrongAssemblyIdentity CreateFrom(Assembly assembly, AssemblyName? assemblyName)

Parameters

assembly Assembly

The assembly to read metadata from.

assemblyName AssemblyName

An optional AssemblyName that may be important for dynamic assemblies to find their CodeBase.

Returns

StrongAssemblyIdentity

The assembly metadata.

CreateFrom(string, AssemblyName?)

Gets the metadata from an assembly at the specified path.

public static StrongAssemblyIdentity CreateFrom(string assemblyFile, AssemblyName? assemblyName)

Parameters

assemblyFile string

The path to the assembly to read metadata from.

assemblyName AssemblyName

The assembly name, if already known; otherwise null.

Returns

StrongAssemblyIdentity

The assembly metadata.

Exceptions

FileNotFoundException

Thrown if assemblyFile does not refer to an existing file.

Equals(StrongAssemblyIdentity?)

public bool Equals(StrongAssemblyIdentity? other)

Parameters

other StrongAssemblyIdentity

Returns

bool

Equals(object?)

public override bool Equals(object? obj)

Parameters

obj object

Returns

bool

GetHashCode()

public override int GetHashCode()

Returns

int