Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
[custom_attrs] Use the image's ALC instead of the default one (dotnet…
…#68266) Running ApiCompat task under Mono fails with: Could not load type System.Collections.Generic.IEqualityComparer`1[[Microsoft.Cci.ITypeReference, Microsoft.Cci ... The reason is that cattr_type_from_name() uses a default ACL instead of the image's one. This is important, because ExportCciSettings.Settings field has the [Export(typeof(IEqualityComparer<ITypeReference>))] custom attribute [1], where ITypeReference comes from the Microsoft.Cci assembly. ApiCompat task runs under MSBuild, which provides its own MSBuildLoadContext ALC. Microsoft.Cci is supposed to be found using this ALC, not the default one. [1] https://github.com/dotnet/arcade/blob/8f311fed1f2acf0ecfdfcecbc7a9fa871ed634cc/src/Microsoft.DotNet.ApiCompat/src/Microsoft.DotNet.ApiCompat.Core/ExportCciSettings.cs#L28
- Loading branch information