When I start a Live Unit Tests session on my solution in visual studio 2017, I get the following message:
No test adapters are referenced by this solution. If you have a test project, add a NuGet reference to a test adapter corresponding to the test framework used in order to run the tests. If you already have the required NuGet reference in your test project, performing a NuGet restore may resolve the issue.
What can I do to remedy this situation?
As the message implies, you need to install some NuGet packages, one for the testing framework and one for the visual studio test runner. If you are upgrading an old solution using MSTest, you first need to remove the reference to Microsoft.VisualStudio.QualityTools.UnitTestFramework
.
Then you need to open the Package Manager Console (under Tools-> Nuget Package Manager -> Package Manager Console). Select your unit test project(s) and run the following commands:
Install-Package MSTest.TestFramework
Install-Package MSTest.TestAdapter
If you are using a different test framework, such as XUnit or NUnit, you have to install either XUnit and xunit.runner.visualstudio, or NUnit and NUnit3TestAdapter