简体   繁体   English

无法在xUnit.net v2中使用控制台运行程序运行第一版xUnit.net测试

[英]Not able to run version one xUnit.net tests using console runner in xUnit.net v2

In my project we are upgrading to xUnit 2. As a result, we upgraded the console runner also which is used to run tests on build server. 在我的项目中,我们正在升级到xUnit 2.结果,我们升级了控制台运行程序,用于在构建服务器上运行测试。

We did not upgrade the exsting test projects to use xUnit 2. They are still referring to xUnit.1.9.2. 我们没有升级exsting测试项目以使用xUnit 2.他们仍然指的是xUnit.1.9.2。

As per the documentation it should work. 根据文档它应该工作。

The console runner in xUnit.net v2 is capable of running unit tests from both xUnit.net v1 and v2. xUnit.net v2中的控制台运行程序能够从xUnit.net v1和v2运行单元测试。

However we see errors. 但是我们看到错误。

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.

These are the list of files I have copied from the package folder of the xunit.runner.console.2.1.0 and kept into the build server folder. 这些是我从xunit.runner.console.2.1.0的包文件夹中复制并保存到构建服务器文件夹中的文件列表。 I invoke xunit.console.x86.exe in my scripts with required parameters. 我在脚本中使用所需参数调用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

It was my mistake. 这是我的错。 The project was referencing another project which had the xunit upgraded to version 2. As a result "xunit.execution.desktop.dll" got pulled into the debug folder which led to the problem. 该项目引用了另一个将xunit升级到版本2的项目。结果“xunit.execution.desktop.dll”被拉入调试文件夹,导致了问题。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM