本文介绍了Visual Studio 2017中缺少创建单元测试上下文菜单选项吗?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我的VS2017副本似乎缺少创建单元测试"上下文菜单选项.

我知道有一些历史记录已被删除,并且

我可以确认这已在最新版本的VS中修复.

解决方案

这似乎是一个已知问题,如下所述:

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

我可以确认,最新版本的VS现在已针对针对完整.NET框架的项目进行了修复.

注意:.NET Core项目仍然无法使用此方法.

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:

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

解决方案

This appears to be a known issue as stated here:

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.

这篇关于Visual Studio 2017中缺少创建单元测试上下文菜单选项吗?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!

07-26 09:42