Visual studio 2010 测试在Visual Studio 2013中消失

Visual studio 2010 测试在Visual Studio 2013中消失,visual-studio-2010,visual-studio-2013,mstest,Visual Studio 2010,Visual Studio 2013,Mstest,我所有的单元测试在VisualStudio2013中突然消失,我似乎无法在测试资源管理器中发现它们 我们使用VisualStudio2010作为主要环境。我已将Visual Studio 2013 Express Desktop安装为我选择的编辑器,在其中工作,然后使用2010进行最终构建/签入。2010年一切顺利。但2013 express将不再发现测试。习惯了,然后在工作的中间,一个改变停止了。这些都是测试 我得到以下测试输出: ------ Discover test started --

我所有的单元测试在VisualStudio2013中突然消失,我似乎无法在测试资源管理器中发现它们

我们使用VisualStudio2010作为主要环境。我已将Visual Studio 2013 Express Desktop安装为我选择的编辑器,在其中工作,然后使用2010进行最终构建/签入。2010年一切顺利。但2013 express将不再发现测试。习惯了,然后在工作的中间,一个改变停止了。这些都是测试

我得到以下测试输出:

------ Discover test started ------
TestTypes\13cdc9d9-ddb5-4fa4-a97d-d965ccfc6d4b could not be loaded because the TIP could not be instantiated for the following reason(s): System.IO.FileNotFoundException: Could not load file or assembly 'Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Tip, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.
File name: 'Microsoft.VisualStudio.QualityTools.Tips.UnitTest.Tip, Version=12.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a'
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMarkHandle stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName, ObjectHandleOnStack type)
   at System.RuntimeTypeHandle.GetTypeByName(String name, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark, IntPtr pPrivHostBinder, Boolean loadTypeFromPartialName)
   at System.RuntimeType.GetType(String typeName, Boolean throwOnError, Boolean ignoreCase, Boolean reflectionOnly, StackCrawlMark& stackMark)
   at System.Type.GetType(String typeName, Boolean throwOnError)
   at Microsoft.VisualStudio.TestTools.TestManagement.TipDelayLoader.LoadTip()

WRN: Assembly binding logging is turned OFF.
To enable assembly bind failure logging, set the registry value [HKLM\Software\Microsoft\Fusion!EnableLog] (DWORD) to 1.
Note: There is some performance penalty associated with assembly bind failure logging.
To turn this feature off, remove the registry value [HKLM\Software\Microsoft\Fusion!EnableLog].

========== Discover test finished: 0 found (0:00:00.1640164) ==========
试图修复的步骤:

  • 已从存储库中签出源的新副本
  • 验证其他开发人员没有此问题(他们的2013安装查找测试)
  • 修复2013
  • 删除2013,重新启动,安装2013
  • 创建了新的WPF项目并添加了测试(该测试已发现,但问题尚未解决)

如有任何建议,将不胜感激。我的下一步是擦除系统,但那将是痛苦的。

我已通过执行以下操作间接修复了此问题:

  • 添加了一个名为Testable的新空类
  • 添加了一个新的单元测试来测试它
(此时,我所有的旧单元测试都与新单元测试一起出现了)

  • 将所有更改恢复为签入的内容
(仍然发现旧的单元测试)


似乎我的代码中没有什么东西导致了问题,添加一个新的单元测试修复了它。没有说明发生的原因,但如果您遇到问题,此过程可能会为您解决。

您正在使用nUnit吗?我刚刚遇到了一个类似的情况,移动到一台新的pc,导致所有现有的测试都消失了

转到工具->扩展和更新->选择左侧的联机->在搜索框右上角输入“nunit测试适配器”并安装它

重新启动VisualStudio


一次重建之后,测试再次出现。

出现了完全相同的问题

在我们的解决方案中,我们有树文件:

  • Local.testsettings
  • LocalTestRun.testrunconfig
  • TraceAndTestImpact.testsettings
备份了这些文件,删除了它们,并在没有这些文件的情况下启动了解决方案。 创建并找到了这些文件。 然后移回文件,它仍然有效


这花费了我们大约两天的时间进行故障排除。如果您有相同的问题,可能值得一试。

任何时候当您对Google test runner有问题时,我希望您尝试将项目作为exe运行,我也有相同的问题,当我使用命令行运行时,我发现我使用的某个dll在我的execute文件夹中丢失

  • 如果您在项目中使用了任何DLL,请验证它们是否在您的execute文件夹(或GAC)中
  • 尝试通过exe(命令行)运行gtest项目,您将获得信息性错误信息,而不是测试消失

  • 我知道这个问题由来已久,但我也遇到了同样的问题,我的一些测试在2013年与NUnit 3的VS中停止出现


    我的测试没有显示出来,因为我在一个类上实现了
    IFormattable
    ,并且在我重建项目后,该类的所有测试都消失了。我使用了Visual Studio生成的
    IFormattable
    接口的默认实现代码,该接口在生成的方法中抛出
    NotImplementedException
    。事实证明,当类的
    ToString
    方法抛出异常时,NUnit测试运行程序不会显示任何测试。在我正确地实现了
    ToString
    方法之后,所有的测试都开始正常显示。

    感谢您的回答。在我遵循您的解决方案之后,我的问题仍然没有得到解决。因为我认为您错过了完成测试的一个步骤。完成所有步骤后,我们必须重新启动Visual Studio。