diff --git a/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs b/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs index 83b90f3ac..8d1324f08 100644 --- a/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs +++ b/src/NUnitEngine/nunit.engine.core/Runners/DirectTestRunner.cs @@ -109,7 +109,7 @@ protected override TestEngineResult LoadPackage() { var testFile = subPackage.FullName; - string targetFramework = subPackage.GetSetting(InternalEnginePackageSettings.ImageTargetFrameworkName, (string)null); + string targetFramework = subPackage.GetSetting(EnginePackageSettings.TargetRuntimeFramework, (string)null); bool skipNonTestAssemblies = subPackage.GetSetting(EnginePackageSettings.SkipNonTestAssemblies, false); if (_assemblyResolver != null && !TestDomain.IsDefaultAppDomain() diff --git a/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs b/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs index f09cff45b..0b99996ba 100644 --- a/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs +++ b/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs @@ -130,7 +130,7 @@ private RuntimeFramework SelectRuntimeFrameworkInner(TestPackage package) if (string.IsNullOrEmpty(imageTargetFrameworkNameSetting)) { - // Assume .NET Framework + // Assume .NET Framework 2.0 targetRuntime = currentFramework.Runtime; targetVersion = package.GetSetting(InternalEnginePackageSettings.ImageRuntimeVersion, new Version(2, 0)); } @@ -142,15 +142,19 @@ private RuntimeFramework SelectRuntimeFrameworkInner(TestPackage package) { case ".NETFramework": targetRuntime = RuntimeType.Net; + targetVersion = frameworkName.Version; break; case ".NETCoreApp": targetRuntime = RuntimeType.NetCore; + targetVersion = frameworkName.Version; + break; + case ".NETStandard": + targetRuntime = RuntimeType.NetCore; + targetVersion = new Version(3, 1); break; default: throw new NUnitEngineException("Unsupported Target Framework: " + imageTargetFrameworkNameSetting); } - - targetVersion = frameworkName.Version; } if (!new RuntimeFramework(targetRuntime, targetVersion).IsAvailable)