Visual Studio 2019 测试资源管理器将所有测试置于“不运行测试"下 [英] Visual Studio 2019 Test Explorer puts all tests under "Not Run Tests"

查看:29
本文介绍了Visual Studio 2019 测试资源管理器将所有测试置于“不运行测试"下的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个带有 Visual Studio Professional 19.4.1xUnit 2.4.0ASP.Net Core 3 项目.我在那里写了几个测试.我的问题是 Visual Studio 始终在未运行测试"下显示此项目中的所有测试.相同的测试在命令行 (dotnet test) 或其他计算机上运行良好.修复/重新安装 Visual Studio 没有帮助.非常需要任何帮助!

I have a ASP.Net Core 3 project with Visual Studio Professional 19.4.1 with xUnit 2.4.0. I have a couple of tests written there. My problem is that Visual Studio shows all the tests in this project always under "Not Run Tests". The same tests run well with command line (dotnet test) or another computer. Repairing/Reinstalling Visual Studio did not help. Any help is much needed!

更新:我还意识到此计算机上不存在扩展DotNet Extensions for Test Explorer.这存在于这些工作的其他计算机上.然而,问题是如何以及从何处获得此扩展?

UPDATE: I also realized that extension DotNet Extensions for Test Explorer is not present on this computer. This is present on other computer where these work. The problem, however, is how and where to get this extension from?

我已经在项目中包含了 xunit.runner.visualstudio 2.4.0.

I already have xunit.runner.visualstudio 2.4.0 included in the project.

任何帮助都很有价值!!!

Any help is much valuable!!!

推荐答案

将 nuget 包 Microsoft.NET.Test.Sdk 升级到 16.4.0(或更新版本).

Upgrade the nuget package Microsoft.NET.Test.Sdk to version 16.4.0 (or newer).

在vs2019新建xunit项目时,安装的Microsoft.NET.Test.Sdk版本是16.2.0,xunit.runner.visualstudio(v2.4.0或更新版本)好像不能用.

When creating a new xunit project in vs2019, the version of Microsoft.NET.Test.Sdk installed is 16.2.0, which xunit.runner.visualstudio (v2.4.0 or newer) doesn't seem to work in.

这篇关于Visual Studio 2019 测试资源管理器将所有测试置于“不运行测试"下的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆