My project has dependencies on some native libraries (DLLs) that I normally copy via the MSBuild targets into the output directory. There is no problem when I run the application, but I am writing some unit tests in Visual Studio and every time I run the unit tests, the assemblies and executables are copied from the output directory into the staging folder: C:\path\to\MyProject\TestResults\myWorkStationName 2012-03-20 13_53_56\Out
Unfortunately the native DLLs are not copied into the staging directory and the staging directory is generated on every test run. Is there an MSbuild target that allows me to copy stuff into the staging directory?
P.S. I’m not sure if “staging directory” is the correct term, so please excuse my ignorance if it’s not :).
Solution wide deployment
From the VS menu:
Test>Edit Test Settings>(settings file)>Deployment> checkEnable deploymentand add a directory or files.Note for one caveat in this feature: enabled deployment for existing tests won’t work until Visual Studio is restarted.
Single method deployment
Use the [DeploymentItem] attribute: