diff --git a/cake/package-tests.cake b/cake/package-tests.cake index 2b5413ab2..7b76d14fe 100644 --- a/cake/package-tests.cake +++ b/cake/package-tests.cake @@ -75,7 +75,7 @@ static PackageTest Net60Test = new PackageTest( static PackageTest Net60X86Test = new PackageTest( "Net60X86Test", "Run mock-assembly-x86.dll under .NET 6.0", - "net6.0/mock-assembly-x86.dll --trace:Debug", + "net6.0/mock-assembly-x86.dll", MockAssemblyExpectedResult(1)); static PackageTest Net50Test = new PackageTest( diff --git a/src/NUnitEngine/nunit.engine.tests/Services/RuntimeFrameworkServiceTests.cs b/src/NUnitEngine/nunit.engine.tests/Services/RuntimeFrameworkServiceTests.cs index d61517e06..744cd0617 100644 --- a/src/NUnitEngine/nunit.engine.tests/Services/RuntimeFrameworkServiceTests.cs +++ b/src/NUnitEngine/nunit.engine.tests/Services/RuntimeFrameworkServiceTests.cs @@ -35,6 +35,7 @@ public void ServiceIsStarted() [TestCase("mock-assembly.dll", false)] [TestCase("../agents/net20/nunit-agent.exe", false)] [TestCase("../agents/net20/nunit-agent-x86.exe", true)] + [TestCase("../netstandard2.0/nunit.engine.api.dll", false)] public void SelectRuntimeFramework(string assemblyName, bool runAsX86) { var package = new TestPackage(Path.Combine(TestContext.CurrentContext.TestDirectory, assemblyName)); diff --git a/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs b/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs index 673b76420..e1f7538d1 100644 --- a/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs +++ b/src/NUnitEngine/nunit.engine/Services/RuntimeFrameworkService.cs @@ -140,7 +140,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)); } @@ -152,15 +152,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 (!IsAvailable(new RuntimeFramework(targetRuntime, targetVersion).Id, runAsX86))