Updated: May 2011
Compares two assembly identities to determine whether they are equivalent after applying portability policy elements from a specified configuration file.
STDAPI CompareAssemblyIdentityWithConfig ( [in] LPCWSTR pwzAssemblyIdentity1, [in] BOOL fUnified1, [in] LPCWSTR pwzAssemblyIdentity2, [in] BOOL fUnified2, [in] struct AssemblyConfig *pAssemblyConfig, [out] BOOL *pfEquivalent, [out] AssemblyComparisonResult *pResult );
CompareAssemblyIdentityWithConfig checks whether pwzAssemblyIdentity1 and pwzAssemblyIdentity2 are equivalent. pfEquivalent is set to true if one or more of the following conditions are true after the application of any elements in pAssemblyConfig that affect portability policy:
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=22.214.171.124, culture=neutral, publicKeyToken=....", and the value of fUnified1 is true, this indicates that all versions of MyAssembly from version 0.0.0.0 to 126.96.36.199 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 the AssemblyComparisonResult enumeration.
Platforms: See .NET Framework System Requirements.
Library: Included as a resource in MsCorEE.dll
.NET Framework Versions: 4