Harden AssemblyDependencyResolver assemblyPaths (#42055)
authorLakshan Fernando <lakshanf@hotmail.com>
Thu, 17 Sep 2020 12:58:36 +0000 (05:58 -0700)
committerGitHub <noreply@github.com>
Thu, 17 Sep 2020 12:58:36 +0000 (05:58 -0700)
commita1f9226e7b7689aa153861b7bb5011e6f272ccc2
tree153719f28895bcd6b05be49e2f9c2dd9173472f8
parent4c55c6471f69cfd0998a3b8632673896b670d1e5
Harden AssemblyDependencyResolver assemblyPaths (#42055)

* Harden AssemblyDependencyResolver assemblyPaths  AssemblyDependencyResolver is made resilience to the case where  hostpolicy.dll returns the same assembly paths by ignoring multiple  entries. This is done by using OrdinalIgnoreCase comparison on Windows and Ordinal comparison elsewhere  Fix #37162

* Pick the first simple assembly for multiples

AssemblyDependencyResolver is made resilience to the case when
hostpolicy.dll returns multiple assembly paths for the same assembly
by picking the first one.

Fix #37162

* missed an extra line

* Test case for casing change with the same assembly

* typo

* Disabled the tests for non-windows

Filed #42334 to track the linux-mac differences

Co-authored-by: Lakshan Fernando <lakshanf@microsoft.com>
src/installer/tests/HostActivation.Tests/DependencyResolution/ResolveComponentDependencies.cs
src/libraries/System.Private.CoreLib/src/System/Runtime/Loader/AssemblyDependencyResolver.cs