更改为.net6,testplatformexception:system.missingmethodexception后,可以发现单位测试。
在将解决方案从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 技术交流群。

绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论