Visual Studio 2019 在测试资源管理器中显示重复测试 [英] Visual Studio 2019 showing duplicate tests in Test Explorer

查看:33
本文介绍了Visual Studio 2019 在测试资源管理器中显示重复测试的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我最近从 2017 年升级的 Visual Studio 2019 中开始出现重复单元测试.我在下面对 Visual Studio 2017 和 2019 进行了并排比较,其中显示了一些测试在未运行的测试下被复制和分类:

Duplicate Unit Tests started showing up for me in Visual Studio 2019, which I recently upgraded from 2017. I’ve a side by side comparison of Visual Studio 2017 and 2019 below, which shows some test were duplicated and categorised under tests not run:

清理解决方案并没有摆脱这些测试,唯一能做的就是删除 git 存储库并再次克隆它.

Cleaning the solution didn’t get rid of these tests and the only thing that did, was deleting the git repository and cloning it again.

有没有人遇到过这个问题并且有比这种大锤方法更好的解决方案?

Has anybody come across this issue and have a better solution that this sledge hammer approach?

推荐答案

我正在与一位也遇到相同问题的同事交谈,他提出了另一种对他有用的解决方案.

I was talking to a colleague who also came across the same issue and he suggested another solution that worked for him.

  • 关闭 Visual Studio.
  • 删除.vs"文件夹.您将找到解决方案 (.sln) 文件所在的文件夹.
  • 打开 Visual Studio.
  • Close Visual Studio.
  • Delete the ".vs" folder. You will find this folder where your solution (.sln) file exists.
  • Open Visual Studio.

这为他解决了这个问题,并且是一种比删除和克隆更不激进的措施.

This resolved the issue for him and is a less drastic measure that a delete and clone.

这篇关于Visual Studio 2019 在测试资源管理器中显示重复测试的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

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