1

Azure DevOps pipeline failing after updating NUnit.ConsoleRunner nuget package to to 3.15 version. Command use to run the nunit test:

exec /Library/Frameworks/Mono.framework/Versions/Current/bin/mono --debug /Users/name/Documents/MyProject/packages/NUnit.ConsoleRunner.3.15.0/tools/nunit3-console.exe /Users/name/Documents/MyProject/TestProject.NUnitTest/bin/Release/TestProject.NUnitTest.dll

Which is throwing below error:

System.ArgumentException : The net-4.5.2 framework is not available. Available frameworks: mono-4.0 --ArgumentException The net-4.5.2 framework is not available. Available frameworks: mono-4.0 at NUnit.Engine.Services.TestAgency.GetAgent (NUnit.Engine.TestPackage package) [0x0008e] in <83a050af71a545d186bc8c62a15c3005>:0 at NUnit.Engine.Runners.ProcessRunner.CreateAgentAndRunnerIfNeeded () [0x0003d] in <83a050af71a545d186bc8c62a15c3005>:0 at NUnit.Engine.Runners.ProcessRunner.RunTests (NUnit.Engine.ITestEventListener listener, NUnit.Engine.TestFilter filter) [0x0001f] in <83a050af71a545d186bc8c62a15c3005>:0

This is working fine with NUnit.ConsoleRunner version 3.8.0. and using target .Net framework vresion 4.5.2 able build and run the testcases in visual studio without any issue(in both the versions)

Link suggesting to edit the nunit-agent.exe.config file from package folder to add supported environment which is not possible in my case as CI/CD each time takes the fresh copy of packages.

nunit-agent.exe.configfile located in \packages\NUnit.ConsoleRunner.3.15.0\tools\ path has the following content, where it is mentioned supported runtime version to 4.0 and 2.0

<?xml version="1.0" encoding="utf-8"?>
<configuration> 
  <startup useLegacyV2RuntimeActivationPolicy="true">
    <supportedRuntime version="v4.0.30319" />
    <supportedRuntime version="v2.0.50727" />
  </startup>
  <runtime> 
    <legacyUnhandledExceptionPolicy enabled="1" /> 
    <legacyCorruptedStateExceptionsPolicy enabled="true" /> 
    <loadFromRemoteSources enabled="true" /> 
    <AppContextSwitchOverrides value="Switch.System.Diagnostics.IgnorePortablePDBsInStackTraces=false" />
  </runtime>
</configuration>

Where as in config file of version 3.8.0 in startup tag has no exlicit mentioned platform versions.

Any hint or suggestion to resolve this issue? Thanks

Suchith
  • 1,276
  • 17
  • 39

1 Answers1

2

Looks like it may be this issue reported last week against nunit-console 3.14: https://github.com/nunit/nunit-console/issues/1130

(If it seems to apply to you, you might comment on the issue.)

Workaround would be to use an earlier console version. The reporter of the issue says 3.12 works.

Charlie
  • 12,928
  • 1
  • 27
  • 31
  • thanks for the input. updated the comment in the link – Suchith Feb 18 '22 at 11:37
  • Can confirm: reverting to 3.12.0 is a workaround. Having the same problem here in a CI build in jenkins (or command line with latest mono). – tekHedd Feb 18 '22 at 18:00