Allow DLL paths when starting Unit Tests from VS IDE

Product: VisualStudio 2012 and its testing infrastructure

I have a solution (MySolution) with one C ++ DLL project (MyClassLib.dll) and one Unit Test project (TestMyClassLib.dll)

When I create a solution with a debug configuration, all the results are published in MySolution \ Debug

However, when I try to run debug tests (Test> Debug> All Tests) or (Test> Run> All Tests), the MyClassLib.dll DLL cannot be resolved.

My assumption is that when the Unit Test infrastructure is running, the working directory is the directory of the Unit Test project.

I tried to set the TestMyClassLib project working directory to the place where all my DLLs are published (MySolution \ Debug), but this does not seem to set the working directory where the test framework works.

What is a simple (not adding an extra copy) and elegant (not changing my PATH) solution to this problem? Is there a "working directory" parameter that I can set for the Unit Test infrastructure when working from the IDE?

I would like the default to be $ (OutDir), not $ (ProjectDir) or whatever it uses. This would make the default behavior consistent for end-to-end IDE operation.

+4
source share

All Articles