我试图在我的.NET Core测试程序集中使用NUnit3.ConsoleRunner版本3.70 NuGet包。我已经安装了NuGet软件包并发现它在这个位置:
%USERPROFILE%\。的NuGet \包\ NUnit.ConsoleRunner \ 3.7.0 \工具\ nunit3-console.exe
如果我针对我的.NET Core 1.1测试程序集运行该工具,如下所示:
nunit3-console.exe MyTestAssembly.dll
我收到以下错误(来自TestResults.xml的代码段):
<failure>
<message><![CDATA[An exception occurred in the driver while loading tests.]]></message>
<stack-trace><![CDATA[
Server stack trace:
at NUnit.Engine.Runners.DirectTestRunner.LoadDriver(IFrameworkDriver driver, String testFile, TestPackage subPackage)
at NUnit.Engine.Runners.DirectTestRunner.LoadPackage()
at NUnit.Engine.Runners.DirectTestRunner.EnsurePackageIsLoaded()
at NUnit.Engine.Runners.DirectTestRunner.RunTests(ITestEventListener listener, TestFilter filter)
at System.Runtime.Remoting.Messaging.StackBuilderSink._PrivateProcessMessage(IntPtr md, Object[] args, Object server, Object[]& outArgs)
at System.Runtime.Remoting.Messaging.StackBuilderSink.SyncProcessMessage(IMessage msg)
Exception rethrown at [0]:
at System.Runtime.Remoting.Proxies.RealProxy.HandleReturnMessage(IMessage reqMsg, IMessage retMsg)
at System.Runtime.Remoting.Proxies.RealProxy.PrivateInvoke(MessageData& msgData, Int32 type)
at NUnit.Engine.ITestEngineRunner.Run(ITestEventListener listener, TestFilter filter)
at NUnit.Engine.Runners.ProcessRunner.RunTests(ITestEventListener listener, TestFilter filter)]]></stack-trace>
</failure>
我也在该程序集中安装了NUnit3TestAdapter NuGet包(版本3.8.0-alpha1),它运行良好,所有测试都通过了。在针对.NET Core项目运行nunit3-console.exe时我错过了什么?我没有问题地在.NET 4.5.2应用程序中工作。