Visual Studio 2019 Test Explorer not working well with xUnit

梦想的初衷 提交于 2021-01-27 22:13:30

问题


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.

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


回答1:


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




回答2:


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




回答3:


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.



来源:https://stackoverflow.com/questions/56682824/visual-studio-2019-test-explorer-not-working-well-with-xunit

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!