Why is VS2010 not copying all DLL files in / bin / debug to the unit test directory?

I have a unit test that depends on some code that uses MEF. When I run the test, MEF (I suppose) MEF tries to load all the dependent DLLs for all the DLL files in the unit test directory.

The problem is that VS2010 for some reason does not copy all the DLLs from the / bin / debug directory to the unit test directory, and I don't know why. Here is an example:

Unit test complains that it cannot load assembly A, so I include project B in which assembly A has a dependency. In the / bin / debug folder for the unit test project, all the DLLs are there, but when I look at the unit test directory, assembly A is missing.

I could start adding DLLs as references to the unit test project one by one, but I feel like it should.

Thoughts?

thanks mark

+5
source share
3 answers

Perhaps the DeploymentItem attribute might help, http://msdn.microsoft.com/en-us/library/ms182475.aspx :

For the DeploymentItem attribute parameter, specify the folder or file that you want to deploy for this test. You can use either an absolute path or a relative path. Relative paths relate to RelativePathRoot found in the .testrunconfig file.

[TestMethod]
[DeploymentItem("MyTestProject\\testdatasource.mdb")]
public void TestMethod1()
{

// TODO: Add test logic here

}
+4
source

You can add the project as a link, and it will sort it. Right-click the ref project tab.

Do not copy the dll itself to the bin \ debug folder.

0
source

- , . , , ( ). , , , , , .

, TestRun MSTest, , - - , " ", , . Visual Studio "" ", .. .

MEF. MEF , , : , MEF . , , . MEF , ( ) .

0

All Articles