Windows Path Variable - Two folders match DLL - Which Is Picked First
For one reason or another I have a PATH variable which has multiple entries where my exe can be located.
I am struggling to find the order that Windows uses when resolving DLLS.
Does it scan the Path variable and the first (in the list) match is used? In my testing it looks like 开发者_Python百科the final one is used.
Does anyone know what the behaviour of this is and whether it is documented anywhere?
I believe that the last one that is read wins.
For .NET, I don't think that the PATH is used. Here is an article that explains CLR probing in more detail.
EDIT:
Here's a better article from MSDN.
Also this article has a nice flowchart that explains some of the assembly loading logic.
精彩评论