P/invoke binding still searching for assembly directory first in service scenarios
From @schellap review comments:
This seems broken before your change -- searchAssemblyDirectory is by default set to true, so the copy next to the assembly will always be picked up over host specified paths. If the host specified a zero-day patched assembly location, that will never get used -- @gkhanna79. Can this be set to FALSE instead or the load be done after the host specified directories? DefaultDllImportSearchPath would still get overriden by host native dll search path settings Once we do the above, then we should make sure the host specified paths are not overridden by DefaultDllImportSearchPath 's setting of the searchAssemblyDirectory flag.
@yizhang82 I am not sure if @schellap is the right person to look into this. The host has no information about what the assembly properties would be like. This is a runtime decision/policy of Interop subsystem. I think you will need to define and drive it.
Also, I dont believe we can merge your PR until this is resolved.
After offline discussion, I'm addressing this with the following PR https://github.com/dotnet/coreclr/pull/5048
Fixed with dotnet/coreclr#5048