0

I have tried running my test using nunit.consolerunner:

C:\Users\\.nuget\packages\nunit.consolerunner\3.11.1\tools>nunit3-console.exe "D:\Automation\bin\Debug\netcoreapp3.1\la-automation.dll" --where "cat=KK"
NUnit Console Runner 3.11.1 (.NET 2.0)
Copyright (c) 2020 Charlie Poole, Rob Prouse
Sunday, April 3, 2022 9:25:35 PM

Runtime Environment
   OS Version: Microsoft Windows NT 6.2.9200.0
   Runtime: .NET Framework CLR v4.0.30319.42000

Test Files
    D:\Automation\bin\Debug\netcoreapp3.1\la-automation.dll

Test Filters
    Where: cat=KK


Errors, Failures and Warnings

1) Error :
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
The NUnit 3 driver encountered an error while executing reflected code.

Server stack trace:
   at NUnit.Engine.Drivers.NUnit3FrameworkDriver.CreateObject(String typeName, Object[] args)
   at NUnit.Engine.Drivers.NUnit3FrameworkDriver.Load(String testAssemblyPath, IDictionary`2 settings)
   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)
--
InvalidCastException
Unable to cast transparent proxy to type 'System.Web.UI.ICallbackEventHandler'.
   at NUnit.Framework.Api.FrameworkController.LoadTestsAction..ctor(FrameworkController controller, Object handler)

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2022-04-03 15:55:36Z
    End time: 2022-04-03 15:55:38Z
    Duration: 1.650 seconds

Results (nunit3) saved as TestResult.xml

Can you please help on this issue.?

Configuration:

  • NUnit - 3.13.1
  • NUnit.Console - 3.11.1
  • NUNit.ConsoleRunner - 3.11.1
  • NUnit3TestAdapter - 4.0.0
  • SpecFlow - 3.9.40
  • SpecFlow.Actions.WindowsAppDriver - 0.1.177
  • SpecFlow.NUnit - 3.9.40
Greg Burghardt
  • 17,900
  • 9
  • 49
  • 92
Kiran
  • 1
  • 2
  • I found this question: [Does .NET Core work with the NUnit console runner?](https://stackoverflow.com/q/52835507/3092298), but it is 4 years old. It mentioned that NUnit did not support .NET Core, but another answer claims that NUnit 3.11 introduced support for .NET Core. Is this a new project? Were tests running before? What changed? – Greg Burghardt Apr 05 '22 at 11:33
  • Hi @GregBurghardt, Thanks for your quick response. I am new to this SpecFlow and created a framework and trying to run through command line. Can you please refer the error and my project configuration. How to resolve the issue? – Kiran Apr 06 '22 at 05:15
  • Do you have a `[BeforeScenario]` or `[AfterScenario]` hook? Where is a System.Web.UI.ICallbackEventHandler object being used in your test framework? Unforutnately we need to see some code. It won't be possible to answer your question without a [repro]. – Greg Burghardt Apr 06 '22 at 11:14

0 Answers0