依赖托管dll的C ++单元测试 [英] C++ unit testing with dependencies on managed dlls
问题描述
我正在VS 2015中使用本机单元测试项目和测试资源管理器来测试某些本机C ++代码.它可以正常工作,但在某些测试中,代码取决于对c ++/cli或C#dll的调用,然后崩溃,但出现以下异常:
I am using a Native Unit Test Project and Test Explorer in VS 2015 to test some native C++ code. It works ok but in some tests the code depends on calls to c++/cli or C# dlls then it crashes with the exception:
...中的"System.IO.FileNotFoundException"
'System.IO.FileNotFoundException' in ...
其他信息:无法加载文件或程序集...
Additional information: Could not load file or assembly ...
测试项目与其c ++/cli和C#依赖项位于同一目录中.
The test project is in the same directory as its c++/cli and C# dependecies.
有什么建议吗?
先谢谢了.
Thanks in advance.
推荐答案
您好,JirK,
Hi JirK,
似乎我以前遇到过类似的问题:
It seems that I met the similar issue before:
>>测试项目与其c ++/cli和C#依赖项位于同一目录中.
>>The test project is in the same directory as its c++/cli and C# dependencies.
所以您的意思是说,它们处于相同的解决方案路径中,对吗?如何将dll文件复制到测试项目的bin/debug文件夹中?
So you mean that they are in the same solution path, am I right? How about copying the dll file to your test project's bin/debug folder?
最好的问候,
Jack
这篇关于依赖托管dll的C ++单元测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!