Background My team is using Visual Studio 2017, though I suspect multiple versions are affected. Basically, the post Unit Tests not discovered in Visual Studio 2017, is the first problem I ran into where multiple test projects in the same solution were added by different team members. The problem for us turned out to be because of different versions were being added and somehow that confused VS and it would not find some of our unit tests. In our case, my teammate had added a v1.1.11, and mine was 1.1.18. That caused my new tests on the latter version not to be discovered. Just now I created a new .net unit test project (full .net) and it created them with a 1.2 reference. This leads me to this question...
The Question Why does Visual Studio Unit Test Framework version keep changing in a single solution as new test projects are added? It apparently pulls in whatever the latest version is from NuGet, regardless of the pre-existing versions already in use within a solution. Then the follow up question would be, is there a way to control Visual Studio. Certainly you can manually either:
a. rollback to a prior version to have all test projects in your solution match or
b. roll everything forward
c. just ignore and assume that versions will be compatible in the future and not run into issues noted above.
Note that either a. or b. requires manual intervention in what would originally (back in the day before NuGet and MSTest was just included in your VS install) just be handled automatically via a VS patch etc.
Also, given we are starting to see side-by-side versions of MS, I'm curious about best practices (yes I know that is not in question format, so just consider blogging about it somewhere else... I just wanted to plant the seed).
Ref.
- https://github.com/microsoft/testfx
- https://www.nuget.org/packages/MSTest.TestFramework/
- General VS Unit Test discover-ability issues, see: Visual Studio 2015 does not discover unit tests