nunit-console icon indicating copy to clipboard operation
nunit-console copied to clipboard

nunit-console 3.18.* fails on a mixed wpf net48 and netstandard2.0 project

Open oscgu opened this issue 1 year ago • 1 comments

To follow up on my previous comment here (https://github.com/nunit/nunit-console/issues/1465#issuecomment-2477057106): I have now created a minimal project with which the issue can be reproduced repro.zip. Additionally I added a small script run.ps1 that downloads the console-runner, does a nuget restore, builds the solution and then starts the console-runner. With and without tests in the project, the following error always appears:

Time Elapsed 00:00:02.34
NUnit Console Runner 3.18.3 (Release)
Copyright (c) 2022 Charlie Poole, Rob Prouse
Friday, November 15, 2024 9:16:32 PM

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

Test Files
    .\\nunit-issue-repro.sln


Errors, Failures and Warnings

1) Error : C:\tmp\Library\bin\Debug\netstandard2.0\Library.dll
System.ArgumentException : The netcore-4.5 framework is not available for X86=False.
Available frameworks: net-4.0 net-4.5 net-4.5.1 net-4.5.2 net-4.6 net-4.6.1 net-4.6.2 net-4.7 net-4.7.1 net-4.7.2 net-4.8 netcore-6.0 netcore-8.0
--ArgumentException
The netcore-4.5 framework is not available for X86=False.
Available frameworks: net-4.0 net-4.5 net-4.5.1 net-4.5.2 net-4.6 net-4.6.1 net-4.6.2 net-4.7 net-4.7.1 net-4.7.2 net-4.8 netcore-6.0 netcore-8.0
   at NUnit.Engine.Services.TestAgency.GetAgent(TestPackage package) in D:\a\nunit-console\nunit-console\src\NUnitEngine\nunit.engine\Services\TestAgency.cs:line 71
   at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded() in D:\a\nunit-console\nunit-console\src\NUnitEngine\nunit.engine\Runners\ProcessRunner.cs:line 250
   at NUnit.Engine.Runners.ProcessRunner.RunTests(ITestEventListener listener, TestFilter filter) in D:\a\nunit-console\nunit-console\src\NUnitEngine\nunit.engine\Runners\ProcessRunner.cs:line 138

Test Run Summary
  Overall result: Failed
  Test Count: 0, Passed: 0, Failed: 0, Warnings: 0, Inconclusive: 0, Skipped: 0
  Start time: 2024-11-15 20:16:32Z
    End time: 2024-11-15 20:16:33Z
    Duration: 0.513 seconds
                                                                                                                                                                                                                                                                   

I also tried to debug this a little bit and it does seem to make it past the offending line (https://github.com/nunit/nunit-console/blob/main/src/NUnitEngine/nunit.engine/Services/TestAgency.cs#L63) if the vs-project-loader extension is not present, though then it fails because the "File type is not supported". Now I'm stuck on getting the extension loaded/debugged in conjunction with the console-runner.

oscgu avatar Nov 15 '24 21:11 oscgu

@oscgu Is this fixed for you in version 3.19.3?

CharliePoole avatar Mar 13 '25 15:03 CharliePoole