更改为.net6,testplatformexception:system.missingmethodexception后,可以发现单位测试。

发布于 2025-02-09 20:20:36 字数 583 浏览 0 评论 0原文

在将解决方案从Net472更改为.net6之后,VS测试Explorer无法检测到任何测试。我可以在测试资源管理器中看到它们,但是当我开始测试运行时,我会收到未检测到测试的消息。

在测试的输出中,我可以看到此错误:

Microsoft.visualstudio.testplatform.ObjectModel.testPlatFormException:测试主机进程终止了错误:未手持异常。 System.MissingMethodeXception:找不到方法:'void Microsoft.visualstudio.testplatform.crossplatengine.testhostmanagerfactory..ctor(boolean)'。

但是我不知道该如何解决此问题(并且在网上尚未找到任何内容)。

我尝试过的内容:

  • 将vs Studio更新到最新版本(vs Enterprise 2022,17.2.5)。
  • 卸载并重新安装所有Nuget软件包(已安装最新版本)。
  • 检查目标平台
  • 在另一个系统上运行测试,

我感谢有关解决方案的任何其他建议!

多谢!

After I have changed the solution from net472 to .net6, the VS Test Explorer can't detect any tests. I can see them in the test explorer, but when I start a test run, I get the message that no test is detected.

In the output of the test's I can see this error:

Microsoft.VisualStudio.TestPlatform.ObjectModel.TestPlatformException: The test host process terminated with an error: Unhandled Exception. System.MissingMethodException: method not found: 'Void Microsoft.VisualStudio.TestPlatform.CrossPlatEngine.TestHostManagerFactory..ctor(Boolean)'.

But I don't know how to fix this (and haven't found anything on the web).

What I tried:

  • Update VS Studio to the latest version (VS Enterprise 2022, 17.2.5).
  • Uninstall and reinstall all Nuget packages (latest version installed).
  • Check target platforms
  • Run tests on another system

I appreciate any other suggestions for solutions!

Thanks a lot!

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

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

发布评论

需要 登录 才能够评论, 你可以免费 注册 一个本站的账号。
列表为空,暂无数据
我们使用 Cookies 和其他技术来定制您的体验包括您的登录状态等。通过阅读我们的 隐私政策 了解更多相关信息。 单击 接受 或继续使用网站,即表示您同意使用 Cookies 和您的相关数据。
原文