From 132943094673bfe87a75628b0be4fcaf43361c96 Mon Sep 17 00:00:00 2001 From: Veronika Ovsyannikova <150850103+OvesN@users.noreply.github.com> Date: Wed, 13 May 2026 14:08:42 +0200 Subject: [PATCH 1/6] Update BootstrapSdkVersion to 10.0.300 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index ea4e7768135..2104258a9c4 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -81,7 +81,7 @@ - 10.0.107 + 10.0.300 From 70390baea3ea0ba4ace4d066d84fe830b60d192d Mon Sep 17 00:00:00 2001 From: OvesN Date: Thu, 14 May 2026 10:17:13 +0200 Subject: [PATCH 2/6] Update global.json tools.dotnet to 10.0.300 DotNetCliVersion in eng/Versions.props is derived from this and must match BootstrapSdkVersion (already bumped to 10.0.300 in the previous commit on this branch). Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- global.json | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/global.json b/global.json index ef920923812..c80c634fe3d 100644 --- a/global.json +++ b/global.json @@ -10,7 +10,7 @@ "runner": "Microsoft.Testing.Platform" }, "tools": { - "dotnet": "10.0.107", + "dotnet": "10.0.300", "vs": { "version": "18.0" }, From 9c37637a5f057e926199abb6274f61e98b295085 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 17:01:05 +0000 Subject: [PATCH 3/6] Update implicit task host test for apphost Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/70249938-4c85-48dd-9378-777ec7680f3e Co-authored-by: JanProvaznik <25267098+JanProvaznik@users.noreply.github.com> --- src/Build.UnitTests/NetTaskHost_E2E_Tests.cs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs index 3fd5be95a9f..0452ac0faa7 100644 --- a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs +++ b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs @@ -250,12 +250,9 @@ public void NetTaskHost_CallbackBuildProjectFileTest() testTaskOutput.ShouldContain("ChildProject: GetOutputs target executed"); } - [WindowsFullFrameworkOnlyFact] // This test verifies the fallback behavior with implicit host parameters. - public void NetTaskWithImplicitHostParamsTest_FallbackToDotnet() + [WindowsFullFrameworkOnlyFact] // This test verifies app host behavior with implicit host parameters. + public void NetTaskWithImplicitHostParamsTest_AppHostWithImplicitParams() { - using TestEnvironment env = TestEnvironment.Create(_output); - var dotnetPath = env.GetEnvironmentVariable("DOTNET_ROOT"); - string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj"); string testTaskOutput = RunnerUtilities.ExecBootstrapedMSBuild($"{testProjectPath} -restore -v:n -p:LatestDotNetCoreForMSBuild={RunnerUtilities.LatestDotNetCoreForMSBuild}", out bool successTestTask); @@ -268,8 +265,8 @@ public void NetTaskWithImplicitHostParamsTest_FallbackToDotnet() successTestTask.ShouldBeTrue(); // Output from the task where only Runtime was specified - testTaskOutput.ShouldContain($"The task is executed in process: dotnet"); - testTaskOutput.ShouldContain($"Process path: {dotnetPath}", customMessage: testTaskOutput); + testTaskOutput.ShouldContain("The task is executed in process: MSBuild"); + testTaskOutput.ShouldContain(Constants.MSBuildExecutableName, customMessage: testTaskOutput); testTaskOutput.ShouldContain("/nodereuse:True"); // Output from the task where only TaskHost was specified From 2b9db1d5f74e8b5bec1aaf0fe857d7616427de2a Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 17:02:32 +0000 Subject: [PATCH 4/6] Assert task host apphost path Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/70249938-4c85-48dd-9378-777ec7680f3e Co-authored-by: JanProvaznik <25267098+JanProvaznik@users.noreply.github.com> --- src/Build.UnitTests/NetTaskHost_E2E_Tests.cs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs index 0452ac0faa7..2b4c1984554 100644 --- a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs +++ b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs @@ -265,8 +265,9 @@ public void NetTaskWithImplicitHostParamsTest_AppHostWithImplicitParams() successTestTask.ShouldBeTrue(); // Output from the task where only Runtime was specified + string expectedAppHostPath = Path.Combine(RunnerUtilities.BootstrapRootPath, "core", "sdk", RunnerUtilities.BootstrapSdkVersion, Constants.MSBuildExecutableName); testTaskOutput.ShouldContain("The task is executed in process: MSBuild"); - testTaskOutput.ShouldContain(Constants.MSBuildExecutableName, customMessage: testTaskOutput); + testTaskOutput.ShouldContain($"Process path: {expectedAppHostPath}", customMessage: testTaskOutput); testTaskOutput.ShouldContain("/nodereuse:True"); // Output from the task where only TaskHost was specified From 016017e9851231cc4d31efbd30f16041856116f1 Mon Sep 17 00:00:00 2001 From: "copilot-swe-agent[bot]" <198982749+Copilot@users.noreply.github.com> Date: Thu, 14 May 2026 17:03:38 +0000 Subject: [PATCH 5/6] Restore test environment setup Agent-Logs-Url: https://github.com/dotnet/msbuild/sessions/70249938-4c85-48dd-9378-777ec7680f3e Co-authored-by: JanProvaznik <25267098+JanProvaznik@users.noreply.github.com> --- src/Build.UnitTests/NetTaskHost_E2E_Tests.cs | 2 ++ 1 file changed, 2 insertions(+) diff --git a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs index 2b4c1984554..686f9e1275b 100644 --- a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs +++ b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs @@ -253,6 +253,8 @@ public void NetTaskHost_CallbackBuildProjectFileTest() [WindowsFullFrameworkOnlyFact] // This test verifies app host behavior with implicit host parameters. public void NetTaskWithImplicitHostParamsTest_AppHostWithImplicitParams() { + using TestEnvironment env = TestEnvironment.Create(_output); + string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj"); string testTaskOutput = RunnerUtilities.ExecBootstrapedMSBuild($"{testProjectPath} -restore -v:n -p:LatestDotNetCoreForMSBuild={RunnerUtilities.LatestDotNetCoreForMSBuild}", out bool successTestTask); From cc801b74a258141506f8c4b728a17eb47dc8eb56 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Jan=20Provazn=C3=ADk?= Date: Fri, 15 May 2026 13:15:26 +0200 Subject: [PATCH 6/6] Fix NetTaskHost E2E tests for SDK 10.0.300 app host With .NET SDK 10.0.300, the SDK ships an app host (MSBuild.exe) alongside MSBuild.dll. NodeProviderOutOfProcTaskHost.ResolveAppHostOrFallback now takes the app host path whenever {NetCoreSdkRoot}\MSBuild.exe exists, so the parent .NET Framework MSBuild no longer falls back to spawning dotnet.exe MSBuild.dll' when no DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR override is set. Update the two affected tests: * Rename NetTaskHostTest_FallbackToDotnet to NetTaskHostTest_AppHostFromResolvedSdk and assert the TaskHost runs in MSBuild (app host) instead of dotnet. The Process path assertion still uses DOTNET_ROOT as a substring, which matches the resolved app host path ({DOTNET_ROOT}\sdk\\MSBuild.exe). * In NetTaskWithImplicitHostParamsTest_AppHostWithImplicitParams, replace the BootstrapRootPath/core/sdk/... expectation (the test does not point any env var at the bootstrap layout, so the system SDK app host is what actually resolves) with the same DOTNET_ROOT substring assertion used by NetTaskHost_CorrectPathsEscapingTest. Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> --- src/Build.UnitTests/NetTaskHost_E2E_Tests.cs | 26 ++++++++++++++------ 1 file changed, 18 insertions(+), 8 deletions(-) diff --git a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs index 686f9e1275b..a6de82901a7 100644 --- a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs +++ b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs @@ -28,10 +28,13 @@ public NetTaskHost_E2E_Tests(ITestOutputHelper output) } [WindowsFullFrameworkOnlyFact] - public void NetTaskHostTest_FallbackToDotnet() + public void NetTaskHostTest_AppHostFromResolvedSdk() { - // This test verifies the fallback behavior when app host is not used. - // When DOTNET_HOST_PATH points to system dotnet, it uses dotnet.exe + MSBuild.dll. + // This test verifies that without an explicit DOTNET_MSBUILD_SDK_RESOLVER_CLI_DIR override, + // MSBuild resolves the .NET SDK from the standard location (DOTNET_ROOT) and uses the SDK's + // MSBuild.exe app host to spawn the .NET TaskHost. Starting with .NET SDK 10.0.300, the SDK + // ships an app host (MSBuild.exe) alongside MSBuild.dll, so the app host path is preferred + // over the legacy `dotnet.exe MSBuild.dll` fallback. using TestEnvironment env = TestEnvironment.Create(_output); var dotnetPath = env.GetEnvironmentVariable("DOTNET_ROOT"); @@ -45,7 +48,11 @@ public void NetTaskHostTest_FallbackToDotnet() } successTestTask.ShouldBeTrue(); - testTaskOutput.ShouldContain($"The task is executed in process: dotnet"); + + // The TaskHost should be the app host (MSBuild.exe), not `dotnet.exe MSBuild.dll`. + testTaskOutput.ShouldContain("The task is executed in process: MSBuild", customMessage: testTaskOutput); + + // The resolved app host path lives under DOTNET_ROOT (e.g. {DOTNET_ROOT}\sdk\\MSBuild.exe). testTaskOutput.ShouldContain($"Process path: {dotnetPath}", customMessage: testTaskOutput); var customTaskAssemblyLocation = Path.GetFullPath(Path.Combine(AssemblyLocation, "..", RunnerUtilities.LatestDotNetCoreForMSBuild, "ExampleTask.dll")); @@ -254,6 +261,7 @@ public void NetTaskHost_CallbackBuildProjectFileTest() public void NetTaskWithImplicitHostParamsTest_AppHostWithImplicitParams() { using TestEnvironment env = TestEnvironment.Create(_output); + var dotnetPath = env.GetEnvironmentVariable("DOTNET_ROOT"); string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj"); @@ -266,10 +274,12 @@ public void NetTaskWithImplicitHostParamsTest_AppHostWithImplicitParams() successTestTask.ShouldBeTrue(); - // Output from the task where only Runtime was specified - string expectedAppHostPath = Path.Combine(RunnerUtilities.BootstrapRootPath, "core", "sdk", RunnerUtilities.BootstrapSdkVersion, Constants.MSBuildExecutableName); - testTaskOutput.ShouldContain("The task is executed in process: MSBuild"); - testTaskOutput.ShouldContain($"Process path: {expectedAppHostPath}", customMessage: testTaskOutput); + // Output from the task where only Runtime was specified. + // The TaskHost should be the app host (MSBuild.exe) resolved from the standard SDK location + // under DOTNET_ROOT (e.g. {DOTNET_ROOT}\sdk\\MSBuild.exe). Starting with .NET SDK + // 10.0.300 the SDK ships an app host, so it is preferred over `dotnet.exe MSBuild.dll`. + testTaskOutput.ShouldContain("The task is executed in process: MSBuild", customMessage: testTaskOutput); + testTaskOutput.ShouldContain($"Process path: {dotnetPath}", customMessage: testTaskOutput); testTaskOutput.ShouldContain("/nodereuse:True"); // Output from the task where only TaskHost was specified