【发布时间】:2015-09-25 04:17:58
【问题描述】:
在关注了几篇详细介绍如何让 xUnit 与 Team Services Build vNext 一起工作的博客之后:
http://tech.trailmax.info/2014/01/run-xunit-in-hosted-team-foundation-service/
Running unit tests in TFS/VSO Build vNext using xUnit adapter
http://www.donovanbrown.com/post/2015/06/15/how-to-run-xunit-test-with-vnext-build
这些都不适合我。通过检查构建日志,我收到每个测试程序集的以下警告。
--------------------
Warning: [xUnit.net 00:00:00.1644156] Exception discovering tests from CHO.SAM.Business.Test: System.BadImageFormatException:
Could not load file or assembly 'c:\_Work\473cef3c\CHO\CHO.ALL\Tests\CHO.SAM.Business.Test\CHO.SAM.Business.Test\bin\Debug\xunit.execution.desktop.dll' or one of its dependencies. This assembly is built by a runtime newer than the currently loaded runtime and cannot be loaded.
--------------------
有人见过这个吗?如果是的话,你找到解决办法了吗?
我的想法是;我的测试项目是使用 .NET Framework 4.6 编译的,我想知道这是否会导致问题?如果是这样,我将不得不转移到 nUnit 或其他东西,因为我认为仅仅为了使用单个测试框架而更改编译是不正确的。
【问题讨论】:
-
顺便说一句,它在 Visual Studio 中运行良好,可以构建、运行和识别测试......一切都很好。
-
我按照您的链接进行操作,但我的问题似乎略有不同。谢谢... :-)
-
您找到解决方案了吗?我有同样的问题,但使用 4.6.1 构建 TFS 2015 XAML
-
我添加了一个 UI 测试,它就在那里,里面什么都没有!但它会导致它工作。正在使用构建 vNext。所以不知道 XAML..
标签: asp.net-core azure-devops xunit xunit.net azure-pipelines