如何为给定项目禁用 NUnit 适配器?

How to disable NUnit Adapter for given project?

自从我安装了 NUnit Adapter,对于所有项目,即使不使用 NUnit,发现过程仍在进行。

------ Discover test started ------
NUnit Adapter 3.2.0.0: Test discovery starting
Exception NUnit.Engine.NUnitEngineException, Exception thrown discovering tests in I:\src\...
Cannot run tests in process - a 32 bit process is required.
NUnit Adapter 3.2.0.0: Test discovery complete
========== Discover test finished: 0 found (0:00:00.1180118) ==========

如何禁止 NUnit 发现给定项目的测试?

我很确定你每次构建时都为所有程序集安装的所有测试适配器 运行,NUnit 只是有点冗长,这很烦人。

如果测试资源管理器 window 未打开,则不会发现测试。不幸的是,关闭 window 还不够,您需要关闭它,然后重新启动 Visual Studio.

更新: 根据评论,还要确保未选中 保持测试执行引擎 运行


以下是我的系统 运行ning Visual Studio 2015 Update 2;

测试资源管理器Window已关闭,全部重建;

注意,下拉列表中没有测试发现或测试。也可以在Test | 中看到测试设置,测试引擎未运行ning,因为菜单选项被禁用。

然而,一旦我打开 Test Explorer

即使我关闭 window,测试也会继续被发现,直到我重新启动 Visual Studio。

2017 年 Visual Studio 转到工具-> 扩展和更新-> 找到您的 Nunit 适配器并单击禁用