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

查看:141
本文介绍了.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.9 NUnit测试适配器3.1 。我确实做了Google搜索,但得到的答案有冲突。我缺少什么吗?

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 Console是否可以与.NET Core一起使用? #487

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

NUnit Console是使用完整的.NET Framework编译的,当前不支持.NET Core。要从命令行运行.NET Core测试,您需要使用 dotnet测试。有关如何执行此操作的信息,请参见 .NET Core和.NET Standard (NUnit Wiki)。

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天全站免登陆