title: .NET Reference dll from other location
body: <p>I'm making a program depending on some DLLs included in a third party program. I'm not allowed to distribute these DLLs myself. The third party program must be installed for my program to work.</p>
  
  <p>How can i make a reference to these DLLs? I know the exact location of them through a registry key set by the program.</p>
  
  <p>I have tried to add the files in Project->References and set CopyLocal to false but when i start i then get a FileNotFoundException "Could not load file or assembly".</p>
  
  <p>I have tried to add an event to AppDomain.CurrentDomain.AssemblyResolve and load the files there but the problem is that i get the exception before my program even starts. Even if i put a breakpoint on the first line the exception will be thrown before the breakpoint is hit.</p>