UPDATE: Adding a 2019; the discovery/runner integration mechanism is same as per 2017 & 2015, so the key things that can go wrong are the same.
I've read Why is the xUnit runner not finding my tests, which covers reasons xUnit would never be able to find your tests but my problem is different - I'm confident there's nothing subtle going on with my tests; (they have worked in other environments, this seems to be just my machine) - the Visual Studio Test Runner in Visual Studio 2015 [Community Edition] is simply not showing any of my tests. I'm not doing anything remotely exciting; the tests target xUnit.net v2 on the Desktop.
I've looked in the Output window and am not seeing anything in at all under Test in the Show output from tabs.





Eliminate discovery exceptions from your inquiries; go to the output Window (Ctrl-Alt-O), then switch the show output from dropdown (Shift-Alt-S) to Tests and make sure there are no discovery exceptions
Test|Test settings|Default processor architecture can help if your tests are x86/x64 specific and discovery is triggering bittedness-related exceptions, i.e. not AnyCpu
As suggested in this answer(upvote it if the technique helps) running the desktop console runner (instructions) can be a good cross check to eliminate other possibilities, e.g. mangled config files:-
NOTE The
xunit.runner.consolepackage is deprecated - when you get stuff working in VS, you'll be able to havedotnet testrun them in CI contexts tooGo read the documentation - it's comprehensive, up to date, includes troubleshooting info and takes PRs:-
The following steps worked for me:
Do the
DEL %TEMP%\VisualStudioTestExplorerExtensionsas advised :-Install the NuGet Package
xunit.runner.visualstudioin all test projectsPaket:
You need to end up with the following in your
paket.dependencies:Note the
version_in_path: truebit is importantNuget: Go to Package Manager Console (Alt-T,N,O) and
Rebuild to make sure
xunit.runnerends up in the output dirClose Test Explorer <- this was the missing bit for me
Re-open Test Explorer (Alt-S,W,T)
Run All tests (Ctrl R, A)