在VS 2019中运行时,所有单元测试均不确定

时间:2019-10-25 13:10:17

标签: resharper visual-studio-2019

我正在使用Unit Test ExplorerUnit Test Sessions来运行测试并突然出现以下错误。

Test -> Test explorer中运行时,测试根本不会运行,并且我看不到任何错误。

在两种情况下,Output窗口中没有任何内容。我已经重新安装R#,清除了VS缓存(在%USERPROFILE%\AppData\Local\Microsoft中),重新启动了Windows,重新启动了VS。

2019.10.25 14:54:08.058   ERROR Remote: An exception occurred while invoking executor 'executor://mstestadapter/v2': Method not found: 'Void Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.set_CancellationTokenSource(System.Threading.CancellationTokenSource)'.

--- EXCEPTION #1/1 [LoggerException]
Message = “Remote: An exception occurred while invoking executor 'executor://mstestadapter/v2': Method not found: 'Void Microsoft.VisualStudio.TestTools.UnitTesting.TestContext.set_CancellationTokenSource(System.Threading.CancellationTokenSource)'.”
ExceptionPath = Root
ClassName = JetBrains.Util.LoggerException
HResult = COR_E_APPLICATION=80131600
StackTraceString = “
  at JetBrains.ReSharper.UnitTesting.MSTest.Provider.New.TestHost.TestHostMsTestRunner.TestExecutionEventHandler.HandleLogMessage(TestMessageLevel level, String message)
     at Microsoft.TestPlatform.VsTestConsole.TranslationLayer.VsTestConsoleRequestSender.SendMessageAndListenAndReportTestResults(String messageType, Object payload, ITestRunEventsHandler eventHandler, ITestHostLauncher customHostLauncher)
    (...)

1 个答案:

答案 0 :(得分:5)

在整个解决方案中,我已经将NuGet软件包MSTest.TestAdapterMSTest.TestFramework更新到了最新版本(v2.0.0),问题已解决。