3

I've just installed Visual Studio 2019 Professional and I noticed some misbehavior if I compare it to the VS 2017 which I used to work with.

The Test Explorer window

  1. In the VS 2017 when I open a project, that already had been opened previously, I see all the tests in the Test Explorer. In the VS 2019 the window is empty until I rebuild the solution.

  2. If I rebuild the solution and all the xUnit tests are discovered I cannot click on any single test. I can click on all the folders in the hierarchy, but not on the leaf node with the actual test - so I don't see the exception if the test fails or any further details. If I right-click on the test, the possibility Open Test is always disabled.

enter image description here

In VS 2017 the same solution is working fine without any changes.

Jan Drozen
  • 894
  • 2
  • 12
  • 28
  • (No time to investigate) but I have xUnit tests running here in VS2019, other team members have them working in VS2017. – Richard Jun 20 '19 at 11:19
  • 1
    @Richard The xUnit tests themselves are running fine, but the UI is somehow buggy. I switched back to VS2017. – Jan Drozen Jun 20 '19 at 13:14

3 Answers3

4

I had a similar issue,

current workaround :

  1. close all visual studio instances
  2. delete .vs folder at project root
  3. reopen the sln
  4. rebuild
  5. use test explorer to run tests

Reported issue

ManiVI
  • 556
  • 1
  • 5
  • 18
1

By updating the VS the problem disappeared. I am currently running the VS 2019 Pro 16.3.6.

Jan Drozen
  • 894
  • 2
  • 12
  • 28
  • I have similar issue (old tests cases that were updated shows under unknown project), I am on VS Enterprise 2019 16.4.5, below are pkgs – ManiVI Feb 13 '20 at 03:37
  • Updating VS worked for me too, although I had the problem with a much newer version. – Pascal R. Aug 12 '20 at 14:46
0

I had both VS 2017 and VS 2019 installed when I had this issue. Tests worked fine in 2017 but not in 2019. I uninstalled 2017 as it worked for others in my team who just had 2019. As soon as I uninstalled 2017 and did a restart the tests started working for me again.

Abhi
  • 4,872
  • 1
  • 22
  • 20