Compares two assembly identities to determine whether they are equivalent.
STDAPI CompareAssemblyIdentity ( [in] LPCWSTR pwzAssemblyIdentity1, [in] BOOL fUnified1, [in] LPCWSTR pwzAssemblyIdentity2, [in] BOOL fUnified2, [out] BOOL *pfEquivalent, [out] AssemblyComparisonResult *pResult );
CompareAssemblyIdentity checks whether pwzAssemblyIdentity1 and pwzAssemblyIdentity2 are equivalent. pfEquivalent is set to true under one or more of the following conditions:
The two assembly identities are equivalent. For strongly named assemblies, equivalency requires the assembly name, version, public key token, and culture to be identical. For simply named assemblies, equivalency requires a match on the assembly name and culture.
Both assembly identities refer to assemblies that run on the .NET Framework. This condition returns true even if the assembly version numbers do not match.
The two assemblies are not managed assemblies, but fUnified1 or fUnified2 was set to true.
The fUnified flag indicates that all version numbers up to the version number of the strongly named assembly are considered equivalent to the strongly named assembly. For example, if the value of pwzAssemblyIndentity1 is "MyAssembly, version=184.108.40.206, culture=neutral, publicKeyToken=....", and the value of fUnified1 is true, this indicates that all versions of MyAssembly from version 0.0.0.0 to 220.127.116.11 should be treated as equivalent. In such a case, if pwzAssemblyIndentity2 refers to the same assembly as pwzAssemblyIndentity1, except that it has a lower version number, pfEquivalent is set to true. If pwzAssemblyIdentity2 refers to a higher version number, pfEquivalent is set to true only if the value of fUnified2 is true.
The pResult parameter includes specific information about why the two assemblies are considered equivalent or not equivalent. For more information, see AssemblyComparisonResult Enumeration.
Platforms: See .NET Framework System Requirements.
Library: Included as a resource in MsCorEE.dll
.NET Framework Versions: 4.6 Preview, 4.5.2, 4.5.1, 4.5, 4, 3.5 SP1, 3.5, 3.0 SP1, 3.0, 2.0 SP1, 2.0