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

Make sure that your SQL Server Database Project compiles successfully before looking at the SQL Server Object Explorer and right-clicking for the "Create Unit Tests" menu item, otherwise that the menu item will be disabled. Fix SQL from within the project's own scripts until the project compiles, then look again.


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.


Open "Visual Studio Installer" and modify your Visual Studio 2017 edition.

Selecting the Individual Components tab, make sure that under Debugging and testing that Testing tools core features is checked and installed.