title: VisualStudio unit test doesn't find my DLL with P/Invoke. How can I fix this?
body: <p>I'm working on Windows 7 with Visual Studio 2008.</p>
  
  <p>I have a .NET assembly that makes calls into a native DLL with P/Invoke.  I have set up a separate .NET unit test project in my Visual Studio solution that tests the assembly by making various calls into it.  However, when the unit test makes a call into the assembly, and the assembly makes a call using P/Invoke, it can't find the native DLL.</p>
  
  <p>When I write a standalone .NET console application, there is no problem.  The assembly can use P/Invoke and find the DLL successfully.</p>
  
  <p>I can make the unit test work by calling LoadLibrary with the absolute path of the DLL before using the assembly.  However, this approach is ugly and requires an absolute path - which will be problematic for other users.</p>
  
  <p>In short, my question is - how can I specify or amend the DLL search path that is being used when a Visual Studio unit test is being executed?</p>
  
  <p>Any help will be greatly appreciated.</p>
  
  <p>Regards,
  Dan</p>