views:

483

answers:

1

I have an application that loads most of its dll's from a subfolder specified in the configuration (myapp.exe.config) file in the attribute

<probing privatePath="subdir"/>

My question is: Can I load a dll (say mydll.dll) at runtime, using only its filename, if it the dll lives in the same subdirectory "subdir" specified in the probing path?

I tried Assembly.LoadFile("mydll.dll") but that won't search in "subdir".

+1  A: 

Personally I don't really trust trust probe paths - dlls have always been a nightmare, and .net's done nothing to improve that situation. If you're going to use Assembly.Load anyway, and you know exactly where to look, why not just locate the dll for yourself and be sure that you load precisely what you want instead of letting .net decide something 6 years old from a dank corner of the LAN is much more exciting?

Jason Williams