.NET Core 是否与 NUnit 控制台运行器一起使用? [英] Does .NET Core work with the NUnit console runner?

查看:30
本文介绍了.NET Core 是否与 NUnit 控制台运行器一起使用?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个非常简单的测试!

I have a very simple test!

[Test]
public void TestMethod1()
{
    Assert.IsTrue(false);
}

当我尝试使用 nunit3-console.exe 运行它时,出现以下错误.

When I try to run this with nunit3-console.exe I get the following error.

NUnit.Engine.NUnitEngineException : NUnit 3 驱动程序遇到执行反射代码时出错.---->System.InvalidCastException:无法将透明代理转换为类型'System.Web.UI.ICallbackEventHandler'.--NUnitEngineException

NUnit.Engine.NUnitEngineException : The NUnit 3 driver encountered an error while executing reflected code. ----> System.InvalidCastException : Unable to cast transparent proxy to type 'System.Web.UI.ICallbackEventHandler'. --NUnitEngineException

我正在运行 .NET Core 2.1,带有 NUnit Console Runner 3.9NUnit 测试适配器 3.1.我确实做了谷歌搜索并得到了相互矛盾的答案.我错过了什么吗?

I am running .NET Core 2.1, with NUnit Console Runner 3.9 and NUnit test adapter 3.1. I did do a Google search and got conflicting answers. Am I missing something?

推荐答案

我联系了 NUnit 社区并得到了这个答案:NUnit 控制台是否适用于 .NET Core?#487

I reached out to the NUnit community and got this answer: Does NUnit Console work with .NET Core? #487

NUnit 控制台是使用完整的 .NET Framework 编译的,目前不支持 .NET Core.要从命令行运行 .NET Core 测试,您需要使用 dotnet test.有关如何执行此操作的信息,请参阅 .NET Core 和 .NET Standard(NUnit 维基).

NUnit Console is compiled using the full .NET Framework and does not currently support .NET Core. To run .NET Core tests from the command line, you need to use dotnet test. For information on how to do this, see .NET Core and .NET Standard (NUnit wiki).

我们正在考虑创建一个基于 .NET Core 的控制台运行器,但它仍处于规划阶段.

We are looking at creating a .NET Core based console runner, but it is still in the planning stages.

这篇关于.NET Core 是否与 NUnit 控制台运行器一起使用?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
相关文章
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆