This is the weirdest thing. I have a solution with multiple Class Library projects (all .Net Framework 4.7) and multiple unit test projects to test those class libraries. Once in a while I upgrade my NuGet packages to keep them up to date, and some of those upgrades introduces an app.config file to the test-project. Once that app.config is introduced, the tests are not longer discovered by Visual Studio, and therefor they are no longer ran after each build. Considering a failed test is a trigger to correct code, this created a scenario where we would introduce code that failed the unit tests, but because we relied so much on automation, we assumed it succeeded.
In summary: - the existence of an app.config makes VS2017 not discover the tests in the project containing the app.config, even if the app.config is completely empty. Only deleting the config-file will make VS2017 rediscover the tests - Everything in the solution is targeting .Net Framework 4.7 - All Nuget Packages are updated, including the MsTest Adapter and TestFramework - The app.config files are filled only with assemblybinding entries, forinstance:
<?xml version="1.0" encoding="utf-8"?>
<configuration>
<runtime>
<assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
<dependentAssembly>
<assemblyIdentity name="System.Net.Http" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.2" newVersion="4.1.1.2" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.1.1.0" newVersion="4.1.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Runtime.InteropServices.RuntimeInformation" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-4.0.1.0" newVersion="4.0.1.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="Newtonsoft.Json" publicKeyToken="30ad4fe6b2a6aeed" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-10.0.0.0" newVersion="10.0.0.0" />
</dependentAssembly>
<dependentAssembly>
<assemblyIdentity name="System.Net.Http.Formatting" publicKeyToken="31bf3856ad364e35" culture="neutral" />
<bindingRedirect oldVersion="0.0.0.0-5.2.3.0" newVersion="5.2.3.0" />
</dependentAssembly>
</assemblyBinding>
</runtime>
</configuration>