Search code examples
c#visual-studio-2017

Create Unit Tests context menu option missing in Visual Studio 2017?


The 'Create Unit Test' context menu option seems to be missing from my copy of VS2017.

I know there was a bit of history where it was removed and then re-added in VS2015 after much outcry, but as far as I can tell from the Microsoft documentation for VS2017 it should be there now?

The solution I'm working on contains an ASP.NET Web API 2 app, a C# Class Library and a couple of test projects, all targeting .NET Framework 4.5.1. (I'm aware that this option shouldn't be there for .Net Core or .Net Standard projects (as discussed at length in this question).

I've tried right clicking the class name and method name in the code window, the class name tab and the class file in solution explorer all to no avail.

Edit: The "Testing tools core features" is already installed in my copy of VS:

enter image description here

Edit 2: I can confirm this is now fixed in the latest versions of VS.


Solution

  • This appears to be a known issue as stated here:

    Visual Studio Team ♦♦ · 6 days ago 0 (March 17, 2017)

    Thank you for your feedback! We have fixed the problem and the bug fix will be included in an next update release. Thank you for helping us build a better Visual Studio!

    https://developercommunity.visualstudio.com/content/problem/24835/create-unit-tests-missing-when-right-click-in-meth.html

    Edit: I can confirm this is now fixed (for projects targeting the full .NET framework) in the latest versions of VS.

    NB: This is still not expected to be working for .NET Core projects as per this question.