Unit tests not discovered in Visual Studio 2019

Found out that had some assembly conflict not signal by visual studio as usual on the references tree node.

Removing Microsoft.VisualStudio.TestPlatform.TestFramework reference and adding again did the trick.

Here de difference at the project file:


<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">
<Reference Include="Microsoft.VisualStudio.TestPlatform.TestFramework.Extensions, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL">


<Reference Include="Microsoft.VisualStudio.QualityTools.UnitTestFramework, Version=, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a, processorArchitecture=MSIL" />

For me, the other solutions didn't work as I e.g. did not have a reference to the package 'Microsoft.VisualStudio.TestPlatform.TestFramework'. It turned out that the solution for me was updating the Target Framework of the test projects from .NET Core 2.0 to .NET Core 3.1. Everything was working as before when changing that. I'm not sure what caused the issue, but I think it was a combination of three packages. For full reference, these are the ones (with version) I am now using with .NET Core 3.1:


MSTest.TestAdapter 2.1.1

MSTest.TestFramework 2.1.1

On Visual Studio 16.5.2