nunit / nunit3-vs-adapter

NUnit 3.0 Visual Studio test adapter for use under VS 2012 or later
https://nunit.org
MIT License
202 stars 104 forks source link

System.ArgumentException: Unknown framework version 8.0 #1142

Closed akolhe7 closed 7 months ago

akolhe7 commented 7 months ago

When reporting a bug, please provide the following information to speed up triage:

NUnit3.TestAdapter : 4.3.1.0 NUnit Adapter 4.3.1.0:
Visual studio version - Version 17.8.2 .net 8.0

Looking fro a workaround or solution.

Stacktrace:

  The type initializer for 'NUnit.Engine.Services.RuntimeFrameworkService' threw an exception., reason: System.TypeInitializationException: The type initializer for 'NUnit.Engine.Services.RuntimeFrameworkService' threw an exception. ---> System.ArgumentException: Unknown framework version 8.0
  Parameter name: version
     at NUnit.Engine.RuntimeFramework.GetClrVersionForFramework(Version frameworkVersion)
     at NUnit.Engine.RuntimeFramework..ctor(RuntimeType runtime, Version version, String profile)
     at NUnit.Engine.RuntimeFramework.GetNetCoreRuntimesFromDirectoryNames(IEnumerable`1 dirNames)
     at NUnit.Engine.RuntimeFramework.FindDotNetCoreFrameworks()
     at NUnit.Engine.RuntimeFramework.get_AvailableFrameworks()
     at NUnit.Engine.Services.RuntimeFrameworkService..cctor()
     --- End of inner exception stack trace ---

ERROR The type initializer for 'NUnit.Engine.Services.RuntimeFrameworkService' threw an exception., reason: System.TypeInitializationException: The type initializer for 'NUnit.Engine.Services.RuntimeFrameworkService' threw an exception. ---> System.ArgumentException: Unknown framework version 8.0 Parameter name: version at NUnit.Engine.RuntimeFramework.GetClrVersionForFramework(Version frameworkVersion) at NUnit.Engine.RuntimeFramework..ctor(RuntimeType runtime, Version version, String profile) at NUnit.Engine.RuntimeFramework.GetNetCoreRuntimesFromDirectoryNames(IEnumerable1 dirNames) at NUnit.Engine.RuntimeFramework.FindDotNetCoreFrameworks() at NUnit.Engine.RuntimeFramework.get_AvailableFrameworks() at NUnit.Engine.Services.RuntimeFrameworkService..cctor() --- End of inner exception stack trace --- Server stack trace: at NUnit.Engine.Services.RuntimeFrameworkService.ApplyImageData(TestPackage package) at NUnit.Engine.Services.RuntimeFrameworkService.SelectRuntimeFramework(TestPackage package) at NUnit.Engine.Runners.MasterTestRunner.GetEngineRunner() at NUnit.Engine.Runners.MasterTestRunner.Explore(TestFilter filter) at JetBrains.ReSharper.TestRunner.Adapters.NUnit3.NUnitRunner.DiscoverTestsFrom(ITestRunner runner, TestPackage package, RemoteTaskDepot depot) in Z:\BuildAgent\work\1b668fe37ef92293\ReSharperTestRunner\src\Adapters\TestRunner.Adapters.NUnit3\NUnitRunner.cs:line 170 at JetBrains.ReSharper.TestRunner.Adapters.NUnit3.NUnitRunner.<>cDisplayClass5_0.b__0(NUnitTestAssemblyTask assemblyTask) in Z:\BuildAgent\work\1b668fe37ef92293\ReSharperTestRunner\src\Adapters\TestRunner.Adapters.NUnit3\NUnitRunner.cs:line 67 at JetBrains.ReSharper.TestRunner.Adapters.NUnit3.NUnitRunner.RunTests(TestRunRequest request, ITestDiscoverySink discoverySink, ITestExecutionSink executionSink) in Z:\BuildAgent\work\1b668fe37ef92293\ReSharperTestRunner\src\Adapters\TestRunner.Adapters.NUnit3\NUnitRunner.cs:line 85 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 JetBrains.ReSharper.TestRunner.Abstractions.ITestExecutor.RunTests(TestRunRequest request, ITestDiscoverySink discoverySink, ITestExecutionSink executionSink) at JetBrains.ReSharper.TestRunner.Implementation.UnitTestRemoteAgent.Execute(TestRunRequest request) in Z:\BuildAgent\work\1b668fe37ef92293\ReSharperTestRunner\src\TestRunner.Merged\Implementation\UnitTestRemoteAgent.cs:line 96 at JetBrains.ReSharper.TestRunner.Implementation.ClientEndpoint.<>cDisplayClass4_1.b1() in Z:\BuildAgent\work\1b668fe37ef92293\ReSharperTestRunner\src\TestRunner.Core\Implementation\ClientEndpoint.cs:line 56 at System.Threading.Tasks.Task`1.InnerInvoke() at System.Threading.Tasks.Task.Execute() --- End of stack trace from previous location where exception was thrown --- at System.Runtime.ExceptionServices.ExceptionDispatchInfo.Throw() at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task) at JetBrains.ReSharper.TestRunner.Implementation.ClientEndpoint.d10.MoveNext() in Z:\BuildAgent\work\1b668fe37ef92293\ReSharperTestRunner\src\TestRunner.Core\Implementation\ClientEndpoint.cs:line 140``

stevenaw commented 7 months ago

Thanks @akolhe7

I noticed you're using an older version of the adapter. Can you try updating to v4.5.0 of the adapter, NUnit3TestAdapter, to see if the issues persist?

akolhe7 commented 7 months ago

Let me try that.

akolhe7 commented 7 months ago

That worked. Thank you. We can close this issue