Assembly Resolver ignores PrivateBinPath
I have an assembly that I would like to load from an application subfolder. I set this subfolder to PrivateBinPath during AppDomain creation.
The problem is I have a different version of the same DLL in my application. From the way it looks, the recognizer first detects the wrong version, talks about inconsistencies, and stops. As a result, the correct version (located in a subfolder) is never loaded.
I tested this by deleting those dlls in the app and fixing the problem. Is there a way to force the search even if the wrong version is found?
source to share
You can use AppDomainSetup.PrivateBinPathProbe
:
AppDomainSetup.PrivateBinPathProbe = "x"
Edit: Just set this value to a different value than null
, see also this MSDN entry:
http://msdn.microsoft.com/en-us/library/system.appdomainsetup.privatebinpathprobe.aspx
source to share
Do you want to use only PrivateBinPath
? If so, it looks like you can set PrivateBinPathProbe
to any non-null string reference:
Set this property to any non-empty string value, including String.Empty (""), to exclude the application directory path — that is, ApplicationBase — from the search path for the application and search for assemblies only in PrivateBinPath.
Of course it won't help if you want to enable it ApplicationBase
, but use PrivateBinPath
in preference.
source to share