13

I'm using Unit Test Explorer and Unit Test Sessions to run my tests and suddenly get the below error.

When running in Test -> Test explorer, the tests do not run at all and I see no errors.

In both cases there is nothing in Output window. I've reinstalled R#, cleared VS cache (in %USERPROFILE%\AppData\Local\Microsoft), restarted windows, restarted 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)
    (...)
user1713059
  • 1,425
  • 2
  • 17
  • 34

1 Answers1

22

I've updated the NuGet packages MSTest.TestAdapter and MSTest.TestFramework to the newest version (v2.0.0) in the whole solution and the problem was solved.

user1713059
  • 1,425
  • 2
  • 17
  • 34
  • For me it needed some fiddling around with the TestAdapter nuget, but it seems like it was really an old version which caused the problem. I can confirm the solution, although it didn't work in the first place. – andreas Jan 23 '20 at 15:09
  • this worked for me. i have 1.x.x upgraded to 2.x.x and now its working. – Alexander Feb 25 '20 at 12:53