VS2010 Professional下多个解决方案中使用MSTest项目的问题

发布于 2024-11-25 06:30:09 字数 456 浏览 1 评论 0原文

我有一个解决方案,其中包括实用函数的程序集和用于测试这些函数的 MSTest 项目。其中之一依赖于 DLL,它被神奇地复制到正确的测试输出文件夹,并且我的所有测试都运行良好。

我还有一个“主”解决方案,其中包括我的所有程序集及其各自的 MSTest 项目。这里的问题是,需要其他 DLL 的 MSTest 项目无法运行某些测试,因为缺少依赖项。

我阅读了修改 Local.testsettings 的内容,并添加了所需的文件,但测试仍然失败,并且我在 Out 文件夹中没有看到 DLL。这两种解决方案之间的一个显着区别是,前者包含 Local.testsettings、project.vsmdi 和 TraceAndTestImpact.testsettings,而后者则不包含。我盲目地将这些文件添加到后一个解决方案中,但这会导致问题,例如其他测试无法正常运行,此外它并不能解决我原来的问题。

创建聚合所有单元测试项目的主解决方案是否有特殊技巧?

I've got a solution that includes an assembly for utility functions, and an MSTest project for testing those functions. One of them depends on a DLL, which by magic is copied to the correct test output folder, and all of my tests work great.

I've also got a "master" solution that includes all of my assemblies and their respective MSTest projects. The problem here is that the MSTest project which requires that other DLL fails to run some of the tests because the dependency is missing.

I read up on modifying Local.testsettings, and I added the required file, but the test still fails and I don't see the DLL in the Out folder. One notable difference between the two solutions is that the former includes Local.testsettings, project.vsmdi, and TraceAndTestImpact.testsettings, whereas the latter does not. I've blindly added those files to the latter solution, but this causes issues, like other tests not running properly, and in addition it doesn't fix my original problem.

Is there a special trick to creating a master solution that aggregates all of my unit test projects?

如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。

扫码二维码加入Web技术交流群

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。

评论(1

演出会有结束 2024-12-02 06:30:09

您提到您已将 Local.testsettings 添加到项目中,但是您是否在设置中启用了部署并将 dll 添加为要部署的文件?

在此处输入图像描述


其他一些建议:

  • 验证 local.settings 文件中 dll 的相对路径是否
  • 正确Team City 构建定义正在使用 local.testsettings
  • ,如果其他方法都失败,请尝试从命令行运行 mstest.exe,手动指定测试程序集(测试容器)和测试设置。您应该看到任何部署问题作为警告。

You mention that you've added the Local.testsettings to your project, but have you enabled deployment in the settings and added the dll as a file to deploy?

enter image description here


Few other recommendations:

  • verify that the relative path to the dll from the local.settings file is correct
  • verify that the Team City build definition is using your local.testsettings
  • if all else fails, try running mstest.exe from the command line specifying the test assemblies (testcontainers) and test settings manually. You should see any deployment issues as warnings.
~没有更多了~
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文