diff --git a/src/Assets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj b/src/Assets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj index ffcaeed17268..665690317bd7 100644 --- a/src/Assets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj +++ b/src/Assets/DesktopTestProjects/MultiTFMXunitProject/XUnitProject/XUnitProject.csproj @@ -2,7 +2,7 @@ - net461;netcoreapp3.1 + net461;$(CurrentTargetFramework) diff --git a/src/Assets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj b/src/Assets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj index f6826cd79119..09ab1fbdef44 100644 --- a/src/Assets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj +++ b/src/Assets/DesktopTestProjects/NETFrameworkReferenceNETStandard20/MultiTFMTestApp/MultiTFMTestApp.csproj @@ -2,7 +2,7 @@ Exe - netcoreapp3.1;net461 + $(CurrentTargetFramework);net461 diff --git a/src/Tests/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs b/src/Tests/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs index 0c3944ae7b18..1a2cb5aa95da 100644 --- a/src/Tests/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs +++ b/src/Tests/dotnet-build.Tests/GivenDotnetBuildBuildsCsproj.cs @@ -87,7 +87,7 @@ public void ItCanBuildAMultiTFMProjectWithImplicitRestore() string projectDirectory = Path.Combine(testInstance.Path, "MultiTFMTestApp"); new DotnetBuildCommand(Log, projectDirectory) - .Execute("--framework", "netcoreapp3.1") + .Execute("--framework", ToolsetInfo.CurrentTargetFramework) .Should().Pass(); } @@ -183,7 +183,7 @@ public void It_warns_on_rid_without_self_contained_options() { var testInstance = _testAssetsManager.CopyTestAsset("HelloWorld") .WithSource() - .WithTargetFrameworkOrFrameworks("net6.0", false) + .WithTargetFrameworkOrFrameworks(ToolsetInfo.CurrentTargetFramework, false) .Restore(Log); new DotnetBuildCommand(Log) @@ -223,7 +223,7 @@ public void It_does_not_warn_on_rid_with_self_contained_options(string commandNa { var testInstance = _testAssetsManager.CopyTestAsset("HelloWorld", identifier: commandName) .WithSource() - .WithTargetFrameworkOrFrameworks("net6.0", false) + .WithTargetFrameworkOrFrameworks(ToolsetInfo.CurrentTargetFramework, false) .Restore(Log); new DotnetCommand(Log) diff --git a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs index 33c26c162735..5d03dba8679a 100644 --- a/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs +++ b/src/Tests/dotnet-publish.Tests/GivenDotnetPublishPublishesProjects.cs @@ -64,7 +64,7 @@ public void ItImplicitlyRestoresAProjectWhenPublishing() .Should().Pass(); } - [Fact(Skip = "https://github.com/dotnet/sdk/issues/19487")] + [Fact] public void ItCanPublishAMultiTFMProjectWithImplicitRestore() { var testInstance = _testAssetsManager.CopyTestAsset( diff --git a/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs b/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs index 1373c5e749a9..2d36491024bd 100644 --- a/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs +++ b/src/Tests/dotnet-run.Tests/GivenDotnetRunRunsCsProj.cs @@ -72,7 +72,7 @@ public void ItCanRunAMultiTFMProjectWithImplicitRestore() new DotnetCommand(Log, "run") .WithWorkingDirectory(projectDirectory) - .Execute("--framework", "netcoreapp3.1") + .Execute("--framework", ToolsetInfo.CurrentTargetFramework) .Should().Pass() .And.HaveStdOutContaining("This string came from the test library!"); } @@ -127,7 +127,7 @@ public void ItBuildsTheProjectBeforeRunning() .And.HaveStdOutContaining("Hello World!"); } - [Fact(Skip = "https://github.com/dotnet/sdk/issues/19487#issuecomment-898765210")] + [Fact] public void ItCanRunAMSBuildProjectWhenSpecifyingAFramework() { var testAppName = "MSBuildTestApp"; @@ -138,7 +138,7 @@ public void ItCanRunAMSBuildProjectWhenSpecifyingAFramework() new DotnetCommand(Log, "run") .WithWorkingDirectory(testProjectDirectory) - .Execute("--framework", "netcoreapp3.1") + .Execute("--framework", ToolsetInfo.CurrentTargetFramework) .Should().Pass() .And.HaveStdOut("Hello World!"); } diff --git a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs index 5ce49ac40997..f9207c625f7f 100644 --- a/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs +++ b/src/Tests/dotnet-test.Tests/GivenDotnetTestBuildsAndRunsTestFromCsprojForMultipleTFM.cs @@ -142,7 +142,7 @@ public void ItCanTestAMultiTFMProjectWithImplicitRestore() new DotnetTestCommand(Log, ConsoleLoggerOutputNormal) .WithWorkingDirectory(projectDirectory) - .Execute("--framework", "netcoreapp3.0") + .Execute("--framework", ToolsetInfo.CurrentTargetFramework) .Should().Pass(); }