You can specify exactly which files are copied to the test directory using the test parameters file . You can create several test setup files in Visual Studio, so you can use them to work with VS, another to work with MSTest, another to build a CI server, etc. See here for more information: Create test settings to run automated tests from Visual Studio
Use the /testsettings:<filename> parameter to specify it on the command line.
At first it seems that people embarrass people that by default MSTest "current directory" is not the start directory of MSTest, but the "Out" folder of the test results.
As mentioned earlier, MSTest incorrectly displays all used assemblies; if you do not have a direct link, it will not copy the assembly. However, Visual Studio has similar behavior in its assembly, so many people work around this, adding links to dummy code - a terrible solution - I do not recommend it.
However, native DLLs are even more problematic, and I found that they explicitly copy them in the test configuration (test settings), as well as for managed assemblies.
user1164178
source share