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
nameAssemblyNameThe assembly name. Cannot be null.
mvidGuidThe 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
assemblyAssemblyThe assembly to read metadata from.
assemblyNameAssemblyNameAn 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
assemblyFilestringThe path to the assembly to read metadata from.
assemblyNameAssemblyNameThe assembly name, if already known; otherwise null.
Returns
- StrongAssemblyIdentity
The assembly metadata.
Exceptions
- FileNotFoundException
Thrown if
assemblyFiledoes not refer to an existing file.
Equals(StrongAssemblyIdentity?)
public bool Equals(StrongAssemblyIdentity? other)
Parameters
otherStrongAssemblyIdentity
Returns
Equals(object?)
public override bool Equals(object? obj)
Parameters
objobject
Returns
GetHashCode()
public override int GetHashCode()