Quantcast
Channel: Visual Studio and Visual Web Developer Express
Viewing all articles
Browse latest Browse all 3509

Why doesn't Visual Studio 2017 discover my unit tests?

$
0
0

Hello,

Ever since I migrated over to Visual Studio 2017 from 2015, I've been having issues getting my unit tests to be discovered. I have a project with 824 unit tests. Visual Studio 2015 had no trouble discovering them. Then when I opened the project in 2017, no tests were discovered. I tried clearing the solution, rebuilding the solution, rebuilding the Test project, "Run All", etc. but nothing works.

An even bigger issue is that this is affecting Visual Studio 2015. When I go back to VS2015, I find my unit tests are no longer discoverable there too.

SOMETIMES what sort of works is when I update Nuget packages or install new ones. The project has had NUnit since the beginning but Nuget gives me the option to update it. Further, I can also install NUnit3TestAdaptor, NUnitTestAdapter, and NUnit.Runners (which installs a whole bunch of dependency packages). I say SOMETIMES this works because it's hit and miss (different combinations at different times, something nothing), and because it only ever ends up discovering 77 out of the 824 unit tests I have in place.

The last thing I tried, in VS2017, was to undo all my changes to the Test project (which consisted only of all the package installs and updates). I've done this before to no avail, but somehow magically this time it worked: all 824 tests showed up! By UNINSTALLING all additional packages and updates.

So then I open VS2015 <-- There they were! Awesome! I opened VS2017 and... they're gone. Cleaned solution, rebuilt, rebuilt Test project in particular, clicked "Run All" and... nothing. I'm back at square one.

This looks to me like it's a problem with VS2017. When you start it up, and it tries to discover any unit tests, it fails. It not only fails, but it messes things up for other versions of Visual Studio.

Does anyone know what's going on here and how to fix it?


Viewing all articles
Browse latest Browse all 3509

Trending Articles



<script src="https://jsc.adskeeper.com/r/s/rssing.com.1596347.js" async> </script>