Fix load from (dotnet/coreclr#11342)
authorGaurav Khanna <gkhanna@microsoft.com>
Wed, 3 May 2017 15:35:56 +0000 (08:35 -0700)
committerGitHub <noreply@github.com>
Wed, 3 May 2017 15:35:56 +0000 (08:35 -0700)
* Add LoadFrom dependencies to the LoadFrom list

* Add a comment

Commit migrated from https://github.com/dotnet/coreclr/commit/45132a72dce3aeadff09ce8fbee6a663456cda99

src/coreclr/src/mscorlib/src/System/Reflection/Assembly.CoreCLR.cs

index 79f06f3..cfb36e7 100644 (file)
@@ -51,7 +51,8 @@ namespace System.Reflection
             AssemblyName requestedAssemblyName = new AssemblyName(args.Name);
             string requestedAssemblyPath = Path.Combine(Path.GetDirectoryName(requestorPath), requestedAssemblyName.Name+".dll");
 
-            return AssemblyLoadContext.Default.LoadFromAssemblyPath(requestedAssemblyPath);
+            // Load the dependency via LoadFrom so that it goes through the same path of being in the LoadFrom list.
+            return Assembly.LoadFrom(requestedAssemblyPath);
         }
 
         public static Assembly LoadFrom(String assemblyFile)