user761058
user761058

Reputation: 33

MS Test fail to load C++ CLI assemblies

I have a C# based assembly with a class A for which I want to create some unit tests using MS Test in VS 2010. This assembly has a reference to a C++ CLI based assembly, and the class A above calls a managed class in the CLI assembly. When I try to play the test I get the following error: System.IO.FileNotFoundException: Could not load file or assembly 'XXX' or one of its dependencies. The specified module could not be found.

The unit test is inside a C# test project, and items deployment is not enabled.

All projects are configured to have a common output path, and I've checked that all assemblies are there.

Upvotes: 3

Views: 1103

Answers (1)

Yochai Timmer
Yochai Timmer

Reputation: 49251

  1. If it's a COM object, make sure it's registered with regsvr32

  2. make sure that all the files are copied to output directory. (Sometimes the referenced C++/CLI will be copied, but not its dependencies aka unmanaged dlls)

Upvotes: 2

Related Questions