visual-studio - 项目中的每个测试都说 "Excluded from Live Unit Testing"?

标签 visual-studio live-unit-tests

我根据文档添加了测试适配器和框架包 https://docs.microsoft.com/en-us/visualstudio/test/live-unit-testing-faq?view=vs-2017 .

我在每个测试旁边看到“烧杯”符号\图标,但悬停表示它已从实时单元测试中排除。

手动测试都运行良好,我尝试右键单击并告诉它包括在内,但什么也没做。我在这里没有手动排除任何代码......

.net 4.7.1 项目

编辑

有错误

[10:03:48.205 Error] [TestRunner 1] An exception occurred while invoking executor 'executor://mstestadapter/v2': Could not load file or assembly 'System.Xml.ReaderWriter, Version=4.1.1.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified. Could not load file or assembly 'System.Xml.ReaderWriter, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.



这是一个 4.7.1 项目,用于测试另一个基于 EFCore 的 4.7.1 项目。

最佳答案

我遇到了类似的错误,在“实时单元测试”类别的输出窗口中,我发现了以下错误:

FatalError - System.AggregateException: One or more errors occurred. ---> System.Exception: Could not load file or assembly 'System.Runtime, Version=4.0.0.0, Culture=neutral, PublicKeyToken=b03f5f7f11d50a3a' or one of its dependencies. The system cannot find the file specified.

我下载了那个 nuget 包的最新版本,但没有帮助,我基本上不得不在配置文件中强制使用 4.0.0.0 版本,这没有多大意义,因为 dll 的实际版本是 4.1。 2.0.无论如何,在那之后我停止并开始了 Live Unit Testing,现在它可以正常工作了。希望这可以帮助。
<assemblyIdentity name="System.Runtime" publicKeyToken="b03f5f7f11d50a3a" culture="neutral" /> <bindingRedirect oldVersion="0.0.0.0-4.1.2.0" newVersion="4.0.0.0" />

关于visual-studio - 项目中的每个测试都说 "Excluded from Live Unit Testing"?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52005404/

相关文章:

c++ - 为什么编译器资源管理器上的 Visual Studio 忽略异常模型设置?

visual-studio - 适用于 Windows 8 的 Visual Studio 11 Express 仅适用于 WinRT?

Visual Studio 2012 中的 C

c# - 如何强制用户在 Visual Studio for C# 中记录类成员?

visual-studio - 测试运行突然停止时(可能在任务管理器中或由于崩溃)MS Test 抛出什么异常

c# - Visual Studio 实时单元测试和旧测试

visual-studio-2017 - 为什么我收到 "No test adapters are referenced by this solution"错误消息?

unit-testing - 实时单元测试不起作用 "Failed to initialize client proxy: could not connect to test process."