Hello,
I'm working on Windows 7 with Visual Studio 2008.
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.
When I write a standalone .NET console application, there is no problem. The assembly can use P/Invoke and find the DLL successfully.
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.
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?
Any help will be greatly appreciated.
Regards, Dan