Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

All unit tests Inconclusive when run in VS 2019

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)
    (...)
like image 512
user1713059 Avatar asked Oct 25 '19 13:10

user1713059


People also ask

How do I run all unit tests in Visual Studio?

To run all the tests in a default group, choose the Run icon and then choose the group on the menu. Select the individual tests that you want to run, open the right-click menu for a selected test and then choose Run Selected Tests (or press Ctrl + R, T).

How do I add code coverage to Runsettings?

You can enable this in runsettings by adding <Format>Cobertura</Format> or <Format>Xml</Format> in the DataCollector configuration section in your runsettings file. This format can be viewed in the code coverage results window in Visual Studio Enterprise.


1 Answers

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.

like image 175
user1713059 Avatar answered Sep 17 '22 15:09

user1713059