我有一个非常简单的测试!
[Test]
public void TestMethod1()
{
Assert.IsTrue(false);
}
当我尝试使用 nunit3-console.exe 运行此程序时,出现以下错误。
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。我确实进行了谷歌搜索并得到了相互矛盾的答案。我错过了什么吗?
最佳答案
我联系了 NUnit 社区并得到了这个答案: Does NUnit Console work with .NET Core? #487
NUnit Console 使用完整的 .NET Framework 编译,目前不支持 .NET Core。要从命令行运行 .NET Core 测试,您需要使用 dotnet test
。有关如何执行此操作的信息,请参阅 .NET Core and .NET Standard (NUnit 维基)。
我们正在考虑创建一个基于 .NET Core 的控制台运行程序,但仍处于规划阶段。
关于.net-core - .NET Core 是否可以与 NUnit 控制台运行程序一起使用?,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/52835507/