Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
12 changes: 11 additions & 1 deletion src/mono/mono/metadata/assembly.c
Original file line number Diff line number Diff line change
Expand Up @@ -1061,7 +1061,8 @@ netcore_load_reference (MonoAssemblyName *aname, MonoAssemblyLoadContext *alc, M
*
* 7. If this is a satellite request, call the ALC ResolveSatelliteAssembly method.
*
* 8. Call the ALC Resolving event.
* 8. Call the ALC Resolving event. If the ALC is not the default and this is not
* a satellite request, call the Resolving event in the default ALC first.
*
* 9. Call the ALC AssemblyResolve event (except for corlib satellite assemblies).
*
Expand Down Expand Up @@ -1138,6 +1139,15 @@ netcore_load_reference (MonoAssemblyName *aname, MonoAssemblyLoadContext *alc, M
}
}

// For compatibility with CoreCLR, invoke the Resolving event in the default ALC first whenever loading
// a non-satellite assembly into a non-default ALC. See: https://github.com/dotnet/runtime/issues/54814
if (!is_default && !is_satellite) {
reference = mono_alc_invoke_resolve_using_resolving_event_nofail (mono_alc_get_default (), aname);
if (reference) {
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Assembly found with the Resolving event (default ALC): '%s'.", aname->name);
goto leave;
}
}
reference = mono_alc_invoke_resolve_using_resolving_event_nofail (alc, aname);
if (reference) {
mono_trace (G_LOG_LEVEL_DEBUG, MONO_TRACE_ASSEMBLY, "Assembly found with the Resolving event: '%s'.", aname->name);
Expand Down