this may be a stupid question but when I add a reference to my project and set Copy Local to false (so it doesn’t copy the dll to the working directory) I get this error:
Could not load file or assembly 'HtmlAgilityPack, Version=1.4.0.0, Culture=neutral, PublicKeyToken=bd319b19eaf3b43a' or one of its dependencies. The system cannot find the file specified.
All I want is to load the dlls from “(working directory)/dlls”
Is this even possible? And what am I doing wrong?
Thanks in advance!
References simply aren’t resolved relative to the working directory of the process – they’re resolved relative to the assembly which is trying to load them (or from the GAC of course).
It’s not clear why you want to do this, but basically you should make sure the DLL is available in the same location as the executable.