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
AssemblyNameThe assembly name. Cannot be null.
mvid
GuidThe 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
Name
Gets the assembly's full name.
public AssemblyName Name { get; }
Property Value
Methods
CreateFrom(Assembly, AssemblyName?)
Gets the metadata from an assembly.
public static StrongAssemblyIdentity CreateFrom(Assembly assembly, AssemblyName? assemblyName)
Parameters
assembly
AssemblyThe assembly to read metadata from.
assemblyName
AssemblyNameAn 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
stringThe path to the assembly to read metadata from.
assemblyName
AssemblyNameThe 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
Equals(object?)
public override bool Equals(object? obj)
Parameters
obj
object
Returns
GetHashCode()
public override int GetHashCode()