// This method is invoked by the VM to resolve an assembly reference using the Resolving event
        // after trying assembly resolution via Load override and TPA load context without success.
        private static Assembly?ResolveUsingResolvingEvent(IntPtr gchManagedAssemblyLoadContext, AssemblyName assemblyName)
        {
            AssemblyLoadContext context = (AssemblyLoadContext)(GCHandle.FromIntPtr(gchManagedAssemblyLoadContext).Target) !;

            // Invoke the AssemblyResolve event callbacks if wired up
            return(context.ResolveUsingEvent(assemblyName));
        }
예제 #2
0
        // Invoked by Mono to resolve using the Resolving event after
        // trying the Load override and default load context without
        // success.
        private static Assembly?MonoResolveUsingResolvingEvent(IntPtr gchALC, string assemblyName)
        {
            AssemblyLoadContext context = GetAssemblyLoadContext(gchALC);

            return(context.ResolveUsingEvent(new AssemblyName(assemblyName)));
        }