I have a dll named A.dll with strong name, another assembly B references A.dll. I place A.dll in c:\myapp, also A.dll is installed in GAC. I hope assembly B loads the A.dll from c:\myapp not GAC. But it always load the A.dll from GAC. My question is how to load a referenced dll from specified local location not GAC. Thanks.
According to the MSDN page about how the CLR loads assemblies, the CLR will load assemblies from the GAC before attempting to load assemblies from the working directory. There doesn't appear to be a way around this.
Alternatively, you could just not add the assembly to the GAC so that the CLR would be forced to find the assembly by probing.
You'll have to give it a different [AssemblyVersion]. Which ultimately makes sense, if the version numbers are the same then there's no reason that the GAC version wouldn't be good.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With