【发布时间】:2016-07-27 20:24:56
【问题描述】:
在我的项目中,我们正在升级到 xUnit 2。因此,我们升级了控制台运行器,它也用于在构建服务器上运行测试。
我们没有升级现有的测试项目以使用 xUnit 2。它们仍然指的是 xUnit.1.9.2。
根据documentation,它应该可以工作。
xUnit.net v2 中的控制台运行器能够从 xUnit.net v1 和 v2 运行单元测试。
但是我们看到了错误。
xUnit.net Console Runner (32-bit .NET 4.0.30319.18444)
System.IO.FileNotFoundException: Could not load file or assembly 'xunit.abstractions, Version=2.0.0.0, Culture=neutral, PublicKeyToken=8d05b1bb7a6fdb6c' or one of its dependencies. The system cannot find the file specified.
这些是我从 xunit.runner.console.2.1.0 的包文件夹中复制并保存到构建服务器文件夹中的文件列表。我在我的脚本中使用必需的参数调用 xunit.console.x86.exe。
HTML.xslt
NUnitXml.xslt
xunit.abstractions.dll
xunit.console.exe
xunit.console.exe.config
xunit.console.x86.exe
xunit.console.x86.exe.config
xunit.runner.reporters.desktop.dll
xunit.runner.utility.desktop.dll
xUnit1.xslt
【问题讨论】:
-
疯狂猜测:文件是否已解锁?无论哪种方式,Fusion Log Viewer 都应该有答案(或附加调试器并查看内部异常)。
标签: unit-testing xunit.net xunit2