Fix Satellite Assembly loading (dotnet/coreclr#24191)
authorSteve MacLean <stmaclea@microsoft.com>
Mon, 29 Apr 2019 19:37:28 +0000 (15:37 -0400)
committerGitHub <noreply@github.com>
Mon, 29 Apr 2019 19:37:28 +0000 (15:37 -0400)
commit69e8aaa758a6322224a01f9169ead3f5c194f155
tree34e52c5a61de14a33108ef4ce674d6a73c3961c9
parent650c3cb2752bfdb58222e3ed66a73898bba635c1
Fix Satellite Assembly loading (dotnet/coreclr#24191)

* Fix Satellite Assembly loading

When loading satellite assemblies, we should probe next to the parent
assembly and load into the same AssemblyLoadContext as the parent
assembly.

Disable fallback probing for satellite assemblies.

Add AssemblyLoadContext.Resolving handler to probe for satellite
assemblies next to parent

Fixes dotnet/coreclr#20979

* Call ResolveSatelliteAssembly from native

Only call ResolveSatelliteAssembly from native when
resolving a satellite assembly

* PR Feedback

Minimize string creation
Remove unnecessary if null checks
Eliminate corner cases by only allowing one case insensitive matching directory.

* ResolveSatelliteAssembly should ...

ResolveSatelliteAssembly should always be called on the ALC which loaded parentAssembly

Simplify code.
Add Debug.Assert

* Remove case insensitive culture search

* PR Feedback

* Fix parentAssembly logic

* Fixes from initial testing

* Add probe for lower case culture name

* PR feedback

Commit migrated from https://github.com/dotnet/coreclr/commit/a65e2b9f1fe36d9b4dd0c850ec71984919547e18
src/coreclr/src/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.CoreCLR.cs
src/coreclr/src/binder/clrprivbinderassemblyloadcontext.cpp
src/coreclr/src/vm/appdomain.cpp
src/coreclr/src/vm/baseassemblyspec.h
src/coreclr/src/vm/baseassemblyspec.inl
src/coreclr/src/vm/mscorlib.h
src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyLoadContext.cs