I have a Visual Studio solution with a C# dll project. This solution has also a test project which references the output of the C# dll project. The referenced project dll has set Copy Local = true.
If I run this test from the Visual Studio, it works fine.
But if I run it from the MSBuild task, for some reason MSTest does not copy the referenced C# dll to the MSTest working folder, so the test fails. The weird thing is, that all the other referenced libaries are copied to the MSTest working folder. And if I put a
[DeploymentItem(@"PleaseCopyThis.dll")]
before my test method, finally it is copied to the MSTest working folder and my test runs fine.
But why does Visual Studio copy only the referenced dlls which are not part of the solution, but does not copy the referenced project dlls?