使用非托管 DLL 进行 TFS 单元测试
我们需要测试引用非托管 C++ DLL 的 .NET Wrapper DLL 的 .NET 应用程序。
TFS 单元测试项目仅复制 .NET Wrapper DLL,并且最后一项 abd 测试不会失败。
我如何告诉 MSTest 复制所有必需的文件?
谢谢。
We need to test a .NET application that references a .NET Wrapper DLL that references unmanaged C++ DLL.
The TFS Unit Testing project only copies the .NET Wrapper DLL and not the last one abd tests fail.
How can I tell to MSTest to copy all the necessary files?
Thanks.
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
解决方案是将所有必需的文件/DLL 添加到 Local.testsettings 文件的 Deployment 部分,并将 /testsettings:Local.testsettings 参数添加到 MSTest 命令行参数列表中。
The solution was to add all the necessary files/DLL to the Deployment section of the Local.testsettings file and to add the /testsettings:Local.testsettings parameter to the MSTest command line list of parameters.
简短的回答:不能。例如,请参阅此答案。
相反,最好的短期解决方案是使用构建后事件。
托管和非托管 dll 可以合并为一个 dll 文件,但有些麻烦。例如 SQLite 就实现了这一点。
Short answer: It cannot. See for example this answer.
Instead the best short term solution is to use a post-build event.
The managed and unmanaged dlls can be merged into one single dll file with some hazzle. For example SQLite achieves this.