Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion eng/Versions.props
Original file line number Diff line number Diff line change
Expand Up @@ -81,7 +81,7 @@
</PropertyGroup>

<PropertyGroup>
<BootstrapSdkVersion>10.0.107</BootstrapSdkVersion>
<BootstrapSdkVersion>10.0.300</BootstrapSdkVersion>
</PropertyGroup>

<Target Name="OverrideArcadeFileVersion" AfterTargets="_InitializeAssemblyVersion">
Expand Down
2 changes: 1 addition & 1 deletion global.json
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
"runner": "Microsoft.Testing.Platform"
},
"tools": {
"dotnet": "10.0.107",
"dotnet": "10.0.300",
Comment thread
OvesN marked this conversation as resolved.
"vs": {
"version": "18.0"
},
Expand Down
26 changes: 18 additions & 8 deletions src/Build.UnitTests/NetTaskHost_E2E_Tests.cs
Original file line number Diff line number Diff line change
Expand Up @@ -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");

Expand All @@ -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\<version>\MSBuild.exe).
testTaskOutput.ShouldContain($"Process path: {dotnetPath}", customMessage: testTaskOutput);

var customTaskAssemblyLocation = Path.GetFullPath(Path.Combine(AssemblyLocation, "..", RunnerUtilities.LatestDotNetCoreForMSBuild, "ExampleTask.dll"));
Expand Down Expand Up @@ -250,8 +257,8 @@ 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");
Expand All @@ -267,8 +274,11 @@ public void NetTaskWithImplicitHostParamsTest_FallbackToDotnet()

successTestTask.ShouldBeTrue();

// Output from the task where only Runtime was specified
testTaskOutput.ShouldContain($"The task is executed in process: dotnet");
// 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\<version>\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");

Expand Down
Loading