[netcore] Implement referenced assembly resolving and ALC.GetLoadContext (mono/mono#15946)
* [netcore] Implement GetLoadContext
* [netcore] Implement ALC-aware referenced assembly resolution.
The process is described in
https://docs.microsoft.com/en-us/dotnet/api/system.runtime.loader.assemblyloadcontext?view=netcore-3.0#usage-in-the-runtime
We try four things until one of them returns a non-null assembly.
1. Check if the assembly is already loaded in the ALC of the requesting
assembly.
2. If the ALC is not the default ALC, invoke the Load override.
3. Try the default ALC (TPA - trusted platform assemblies) loading.
4. Invoke the Resolving event of the original ALC.
The implementation borrows some managed code from
https://github.com/dotnet/coreclr/blob/mono/mono@
8ba2e15201361402acd0ae9710bd37d50785cdfa/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs#L84-L187
It would be nice if that code was shared between the runtimes.
* [runtime] Implement mono_assembly_name_culture_is_neutral
* [netcore] Add mono_alc_invoke_resolve_using_resolve_satellite
* [netcore] Use ResolveSatelliteAssembly for satellite assembly refs
* [netcore] Some AssemblyLoadContextTest tests now pass
System.Runtime.Loader.Tests.AssemblyLoadContextTest.PublicConstructor_Default
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_NullParameter
System.Runtime.Loader.Tests.AssemblyLoadContextTest.LoadFromAssemblyName_AssemblyNotFound
System.Runtime.Loader.Tests.AssemblyLoadContextTest.PublicConstructor_Theory (with isCollectible: False)
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_ValidAssembly
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetLoadContextTest_SystemPrivateCorelibAssembly
System.Runtime.Loader.Tests.AssemblyLoadContextTest.DefaultAssemblyLoadContext_Properties
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetAssemblyNameTest_AssemblyNotFound
System.Runtime.Loader.Tests.AssemblyLoadContextTest.GetLoadContextTest_ValidTrustedPlatformAssembly
Commit migrated from https://github.com/mono/mono/commit/
2f2f6c104b2a0115a7fb1ab24673b587c27e4365