Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Visual Studio 2019 showing duplicate tests in Test Explorer

Duplicate Unit Tests started showing up for me in Visual Studio 2019, which I recently upgraded from 2017. I’ve a side by side comparison of Visual Studio 2017 and 2019 below, which shows some test were duplicated and categorised under tests not run: enter image description here

Cleaning the solution didn’t get rid of these tests and the only thing that did, was deleting the git repository and cloning it again.

enter image description here

Has anybody come across this issue and have a better solution that this sledge hammer approach?

like image 644
Mike Avatar asked Feb 19 '20 15:02

Mike


People also ask

Where is test settings Visual Studio 2019?

Visual Studio 2019 version 16.3 and earlier To specify a run settings file in the IDE, select Test > Select Settings File. Browse to and select the . runsettings file. The file appears on the Test menu, and you can select or deselect it.

How do I stop a test case from running in Visual Studio?

You need to close the Test Explorer Window to prevent automatic running.

Does Visual Studio run tests in parallel?

Visual Studio Test Platform can run test assemblies in parallel.

How do I use test Explorer code in Visual Studio?

Tests can be run from Test Explorer by right-clicking in the code editor on a test and selecting Run test or by using the default Test Explorer shortcuts in Visual Studio. Some of the shortcuts are context-based. This means that they run or debug tests based on where your cursor is in the code editor.


1 Answers

I was talking to a colleague who also came across the same issue and he suggested another solution that worked for him.

  • Close Visual Studio.
  • Delete the ".vs" folder. You will find this folder where your solution (.sln) file exists.
  • Open Visual Studio.

This resolved the issue for him and is a less drastic measure that a delete and clone.

like image 68
Mike Avatar answered Sep 21 '22 02:09

Mike