From c4879ad2b55b765f19b516dd6c2f8b771d867fd6 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Tue, 14 Oct 2025 18:47:14 +0200 Subject: [PATCH 1/8] add Runtime="Net" support --- .../Microsoft.Build.Engine.UnitTests.csproj | 3 ++ src/Build.UnitTests/NetTaskHost_E2E_Tests.cs | 20 +++++++++++++ .../TestNetTaskWithImplicitParams.csproj | 18 ++++++++++++ .../TestNetTaskWithImplicitParams/global.json | 9 ++++++ .../TaskFactories/AssemblyTaskFactory.cs | 2 ++ src/Shared/TypeLoader.cs | 28 ++++++++++++++----- 6 files changed, 73 insertions(+), 7 deletions(-) create mode 100644 src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/TestNetTaskWithImplicitParams.csproj create mode 100644 src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/global.json diff --git a/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj b/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj index 7125da363e5..def08b182d1 100644 --- a/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj +++ b/src/Build.UnitTests/Microsoft.Build.Engine.UnitTests.csproj @@ -134,6 +134,9 @@ PreserveNewest + + PreserveNewest + PreserveNewest diff --git a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs index e11ad0fb945..47768127239 100644 --- a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs +++ b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs @@ -75,5 +75,25 @@ public void MSBuildTaskInNetHostTest() successTestTask.ShouldBeTrue(); testTaskOutput.ShouldContain($"Hello TEST"); } + + [WindowsFullFrameworkOnlyFact] + public void NetTaskWithImplicitHostParamsTest() + { + using TestEnvironment env = TestEnvironment.Create(_output, setupDotnetEnvVars: true); + var bootstrapCorePath = Path.Combine(RunnerUtilities.BootstrapRootPath, "core", Constants.DotnetProcessName); + + string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj"); + + string testTaskOutput = RunnerUtilities.ExecBootstrapedMSBuild($"{testProjectPath} -restore -v:n", out bool successTestTask); + + if (!successTestTask) + { + _output.WriteLine(testTaskOutput); + } + + successTestTask.ShouldBeTrue(); + testTaskOutput.ShouldContain($"The task is executed in process: dotnet"); + testTaskOutput.ShouldContain($"Process path: {bootstrapCorePath}", customMessage: testTaskOutput); + } } } diff --git a/src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/TestNetTaskWithImplicitParams.csproj b/src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/TestNetTaskWithImplicitParams.csproj new file mode 100644 index 00000000000..d969c9a295d --- /dev/null +++ b/src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/TestNetTaskWithImplicitParams.csproj @@ -0,0 +1,18 @@ + + + + net10.0 + + + + $([System.IO.Path]::GetFullPath('$([System.IO.Path]::Combine('$(AssemblyLocation)', '..'))')) + $([System.IO.Path]::Combine('$(TestProjectFolder)', '$(TargetFramework)', 'ExampleTask.dll')) + + + + + + + + + diff --git a/src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/global.json b/src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/global.json new file mode 100644 index 00000000000..611555aea5f --- /dev/null +++ b/src/Build.UnitTests/TestAssets/ExampleNetTask/TestNetTaskWithImplicitParams/global.json @@ -0,0 +1,9 @@ +{ + "sdk": { + // This global.json is needed to prevent builds running in tests using the bootstrap layout from walking + // up the repo tree and resolving our sdk.paths, instead of the bootstrap layout's SDK. + // See https://github.com/dotnet/runtime/issues/118488 for details. + "allowPrerelease": true, + "rollForward": "latestMajor" + } +} diff --git a/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs b/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs index 0880c7dee8b..1625eb6e777 100644 --- a/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs +++ b/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs @@ -274,8 +274,10 @@ internal LoadedType InitializeFactory( ErrorUtilities.VerifyThrowArgumentNull(loadInfo); VerifyThrowIdentityParametersValid(taskFactoryIdentityParameters, elementLocation, taskName, "Runtime", "Architecture"); + bool isTaskHostParamsMatchCurrentProc = true; if (taskFactoryIdentityParameters != null) { + isTaskHostParamsMatchCurrentProc = TaskHostParametersMatchCurrentProcess(taskFactoryIdentityParameters); _factoryIdentityParameters = new Dictionary(taskFactoryIdentityParameters, StringComparer.OrdinalIgnoreCase); } diff --git a/src/Shared/TypeLoader.cs b/src/Shared/TypeLoader.cs index f96c218f22b..50b7b111d66 100644 --- a/src/Shared/TypeLoader.cs +++ b/src/Shared/TypeLoader.cs @@ -212,9 +212,10 @@ private static Assembly LoadAssemblyUsingMetadataLoadContext(AssemblyLoadInfo as internal LoadedType Load( string typeName, AssemblyLoadInfo assembly, - bool useTaskHost = false) + bool useTaskHost = false, + bool isTaskHostParamsMatchCurrentProc = true) { - return GetLoadedType(s_cacheOfLoadedTypesByFilter, typeName, assembly, useTaskHost); + return GetLoadedType(s_cacheOfLoadedTypesByFilter, typeName, assembly, useTaskHost, isTaskHostParamsMatchCurrentProc); } /// @@ -227,7 +228,7 @@ internal LoadedType ReflectionOnlyLoad( string typeName, AssemblyLoadInfo assembly) { - return GetLoadedType(s_cacheOfReflectionOnlyLoadedTypesByFilter, typeName, assembly, useTaskHost: false); + return GetLoadedType(s_cacheOfReflectionOnlyLoadedTypesByFilter, typeName, assembly, useTaskHost: false, isTaskHostParamsMatchCurrentProc: true); } /// @@ -235,7 +236,12 @@ internal LoadedType ReflectionOnlyLoad( /// any) is unambiguous; otherwise, if there are multiple types with the same name in different namespaces, the first type /// found will be returned. /// - private LoadedType GetLoadedType(ConcurrentDictionary, ConcurrentDictionary> cache, string typeName, AssemblyLoadInfo assembly, bool useTaskHost) + private LoadedType GetLoadedType( + ConcurrentDictionary, ConcurrentDictionary> cache, + string typeName, + AssemblyLoadInfo assembly, + bool useTaskHost, + bool isTaskHostParamsMatchCurrentProc) { // A given type filter have been used on a number of assemblies, Based on the type filter we will get another dictionary which // will map a specific AssemblyLoadInfo to a AssemblyInfoToLoadedTypes class which knows how to find a typeName in a given assembly. @@ -246,7 +252,7 @@ private LoadedType GetLoadedType(ConcurrentDictionary, AssemblyInfoToLoadedTypes typeNameToType = loadInfoToType.GetOrAdd(assembly, (_) => new AssemblyInfoToLoadedTypes(_isDesiredType, _)); - return typeNameToType.GetLoadedTypeByTypeName(typeName, useTaskHost); + return typeNameToType.GetLoadedTypeByTypeName(typeName, useTaskHost, isTaskHostParamsMatchCurrentProc); } /// @@ -316,11 +322,11 @@ internal AssemblyInfoToLoadedTypes(Func typeFilter, Assembly /// /// Determine if a given type name is in the assembly or not. Return null if the type is not in the assembly /// - internal LoadedType GetLoadedTypeByTypeName(string typeName, bool useTaskHost) + internal LoadedType GetLoadedTypeByTypeName(string typeName, bool useTaskHost, bool isTaskHostParamsMatchCurrentProc) { ErrorUtilities.VerifyThrowArgumentNull(typeName); - if (useTaskHost && _assemblyLoadInfo.AssemblyFile is not null) + if (ShouldUseMetadataLoadContext(useTaskHost, isTaskHostParamsMatchCurrentProc)) { return GetLoadedTypeFromTypeNameUsingMetadataLoadContext(typeName); } @@ -374,6 +380,14 @@ internal LoadedType GetLoadedTypeByTypeName(string typeName, bool useTaskHost) return type != null ? new LoadedType(type, _assemblyLoadInfo, _loadedAssembly ?? type.Assembly, typeof(ITaskItem), loadedViaMetadataLoadContext: false) : null; } + /// + /// If assembly should use metadata load contxt it will be executed out of proc. + /// + /// Task Host Parameter was specified explicitly in XML or through environment variable. + /// The parameter defines if Runtime/Architecture explicitly defined in XML match current process. + private bool ShouldUseMetadataLoadContext(bool useTaskHost, bool isTaskHostParamsMatchCurrentProc) => + (useTaskHost || !isTaskHostParamsMatchCurrentProc) && _assemblyLoadInfo.AssemblyFile is not null; + private LoadedType GetLoadedTypeFromTypeNameUsingMetadataLoadContext(string typeName) { return _publicTypeNameToLoadedType.GetOrAdd(typeName, typeName => From 6faa17e50e3732a0c72f869e11ff040a94082968 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com> Date: Tue, 14 Oct 2025 18:52:26 +0200 Subject: [PATCH 2/8] Update src/Shared/TypeLoader.cs Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com> --- src/Shared/TypeLoader.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Shared/TypeLoader.cs b/src/Shared/TypeLoader.cs index 50b7b111d66..be95d9b6aec 100644 --- a/src/Shared/TypeLoader.cs +++ b/src/Shared/TypeLoader.cs @@ -381,7 +381,7 @@ internal LoadedType GetLoadedTypeByTypeName(string typeName, bool useTaskHost, b } /// - /// If assembly should use metadata load contxt it will be executed out of proc. + /// If assembly should use metadata load context it will be executed out of proc. /// /// Task Host Parameter was specified explicitly in XML or through environment variable. /// The parameter defines if Runtime/Architecture explicitly defined in XML match current process. From 5c836f1ac01dc0534420f53ddd4f91d0fbc94837 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Tue, 14 Oct 2025 19:18:55 +0200 Subject: [PATCH 3/8] fix the comments --- .../TaskFactories/AssemblyTaskFactory.cs | 6 ++--- src/Shared/TypeLoader.cs | 22 +++++++++---------- 2 files changed, 14 insertions(+), 14 deletions(-) diff --git a/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs b/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs index 1625eb6e777..f1b552ae848 100644 --- a/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs +++ b/src/Build/Instance/TaskFactories/AssemblyTaskFactory.cs @@ -274,10 +274,10 @@ internal LoadedType InitializeFactory( ErrorUtilities.VerifyThrowArgumentNull(loadInfo); VerifyThrowIdentityParametersValid(taskFactoryIdentityParameters, elementLocation, taskName, "Runtime", "Architecture"); - bool isTaskHostParamsMatchCurrentProc = true; + bool taskHostParamsMatchCurrentProc = true; if (taskFactoryIdentityParameters != null) { - isTaskHostParamsMatchCurrentProc = TaskHostParametersMatchCurrentProcess(taskFactoryIdentityParameters); + taskHostParamsMatchCurrentProc = TaskHostParametersMatchCurrentProcess(taskFactoryIdentityParameters); _factoryIdentityParameters = new Dictionary(taskFactoryIdentityParameters, StringComparer.OrdinalIgnoreCase); } @@ -295,7 +295,7 @@ internal LoadedType InitializeFactory( string assemblyName = loadInfo.AssemblyName ?? Path.GetFileName(loadInfo.AssemblyFile); using var assemblyLoadsTracker = AssemblyLoadsTracker.StartTracking(targetLoggingContext, AssemblyLoadingContext.TaskRun, assemblyName); - _loadedType = _typeLoader.Load(taskName, loadInfo, _taskHostFactoryExplicitlyRequested); + _loadedType = _typeLoader.Load(taskName, loadInfo, _taskHostFactoryExplicitlyRequested, taskHostParamsMatchCurrentProc); ProjectErrorUtilities.VerifyThrowInvalidProject(_loadedType != null, elementLocation, "TaskLoadFailure", taskName, loadInfo.AssemblyLocation, String.Empty); } catch (TargetInvocationException e) diff --git a/src/Shared/TypeLoader.cs b/src/Shared/TypeLoader.cs index 50b7b111d66..145b5b08e50 100644 --- a/src/Shared/TypeLoader.cs +++ b/src/Shared/TypeLoader.cs @@ -213,9 +213,9 @@ internal LoadedType Load( string typeName, AssemblyLoadInfo assembly, bool useTaskHost = false, - bool isTaskHostParamsMatchCurrentProc = true) + bool taskHostParamsMatchCurrentProc = true) { - return GetLoadedType(s_cacheOfLoadedTypesByFilter, typeName, assembly, useTaskHost, isTaskHostParamsMatchCurrentProc); + return GetLoadedType(s_cacheOfLoadedTypesByFilter, typeName, assembly, useTaskHost, taskHostParamsMatchCurrentProc); } /// @@ -228,7 +228,7 @@ internal LoadedType ReflectionOnlyLoad( string typeName, AssemblyLoadInfo assembly) { - return GetLoadedType(s_cacheOfReflectionOnlyLoadedTypesByFilter, typeName, assembly, useTaskHost: false, isTaskHostParamsMatchCurrentProc: true); + return GetLoadedType(s_cacheOfReflectionOnlyLoadedTypesByFilter, typeName, assembly, useTaskHost: false, taskHostParamsMatchCurrentProc: true); } /// @@ -241,7 +241,7 @@ private LoadedType GetLoadedType( string typeName, AssemblyLoadInfo assembly, bool useTaskHost, - bool isTaskHostParamsMatchCurrentProc) + bool taskHostParamsMatchCurrentProc) { // A given type filter have been used on a number of assemblies, Based on the type filter we will get another dictionary which // will map a specific AssemblyLoadInfo to a AssemblyInfoToLoadedTypes class which knows how to find a typeName in a given assembly. @@ -252,7 +252,7 @@ private LoadedType GetLoadedType( AssemblyInfoToLoadedTypes typeNameToType = loadInfoToType.GetOrAdd(assembly, (_) => new AssemblyInfoToLoadedTypes(_isDesiredType, _)); - return typeNameToType.GetLoadedTypeByTypeName(typeName, useTaskHost, isTaskHostParamsMatchCurrentProc); + return typeNameToType.GetLoadedTypeByTypeName(typeName, useTaskHost, taskHostParamsMatchCurrentProc); } /// @@ -322,11 +322,11 @@ internal AssemblyInfoToLoadedTypes(Func typeFilter, Assembly /// /// Determine if a given type name is in the assembly or not. Return null if the type is not in the assembly /// - internal LoadedType GetLoadedTypeByTypeName(string typeName, bool useTaskHost, bool isTaskHostParamsMatchCurrentProc) + internal LoadedType GetLoadedTypeByTypeName(string typeName, bool useTaskHost, bool taskHostParamsMatchCurrentProc) { ErrorUtilities.VerifyThrowArgumentNull(typeName); - if (ShouldUseMetadataLoadContext(useTaskHost, isTaskHostParamsMatchCurrentProc)) + if (ShouldUseMetadataLoadContext(useTaskHost, taskHostParamsMatchCurrentProc)) { return GetLoadedTypeFromTypeNameUsingMetadataLoadContext(typeName); } @@ -381,12 +381,12 @@ internal LoadedType GetLoadedTypeByTypeName(string typeName, bool useTaskHost, b } /// - /// If assembly should use metadata load contxt it will be executed out of proc. + /// Determine whether an assembly is likely to be used out of process and thus loaded with a . /// /// Task Host Parameter was specified explicitly in XML or through environment variable. - /// The parameter defines if Runtime/Architecture explicitly defined in XML match current process. - private bool ShouldUseMetadataLoadContext(bool useTaskHost, bool isTaskHostParamsMatchCurrentProc) => - (useTaskHost || !isTaskHostParamsMatchCurrentProc) && _assemblyLoadInfo.AssemblyFile is not null; + /// The parameter defines if Runtime/Architecture explicitly defined in XML match current process. + private bool ShouldUseMetadataLoadContext(bool useTaskHost, bool taskHostParamsMatchCurrentProc) => + (useTaskHost || !taskHostParamsMatchCurrentProc) && _assemblyLoadInfo.AssemblyFile is not null; private LoadedType GetLoadedTypeFromTypeNameUsingMetadataLoadContext(string typeName) { From 64471823709e7029b5ef77993454e9c0e705e4ee Mon Sep 17 00:00:00 2001 From: YuliiaKovalova <95473390+YuliiaKovalova@users.noreply.github.com> Date: Thu, 16 Oct 2025 16:25:02 +0200 Subject: [PATCH 4/8] Update VersionPrefix to 18.0.2 --- eng/Versions.props | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 76fdff319f9..2827086791a 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -3,7 +3,7 @@ - 18.0.0release + 18.0.2release 17.14.8 15.1.0.0 servicing From 6c93248787198f7994333c270cfefe33851df00a Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Mon, 20 Oct 2025 11:23:28 +0200 Subject: [PATCH 5/8] bump test package version --- .../TestAssets/ExampleNetTask/ExampleTask/ExampleTask.csproj | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Build.UnitTests/TestAssets/ExampleNetTask/ExampleTask/ExampleTask.csproj b/src/Build.UnitTests/TestAssets/ExampleNetTask/ExampleTask/ExampleTask.csproj index 918bff548bf..36add8bbb2b 100644 --- a/src/Build.UnitTests/TestAssets/ExampleNetTask/ExampleTask/ExampleTask.csproj +++ b/src/Build.UnitTests/TestAssets/ExampleNetTask/ExampleTask/ExampleTask.csproj @@ -10,8 +10,8 @@ - - + + From fe5db81bd2e6937b65aa2800c516605672025796 Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Mon, 20 Oct 2025 11:42:19 +0200 Subject: [PATCH 6/8] add tiny optimization --- src/Build/Instance/TaskRegistry.cs | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/src/Build/Instance/TaskRegistry.cs b/src/Build/Instance/TaskRegistry.cs index ef60ac899ce..9ffae09a742 100644 --- a/src/Build/Instance/TaskRegistry.cs +++ b/src/Build/Instance/TaskRegistry.cs @@ -1489,8 +1489,12 @@ private bool GetTaskFactory(TargetLoggingContext targetLoggingContext, ElementLo bool isAssemblyTaskFactory = String.Equals(TaskFactoryAttributeName, AssemblyTaskFactory, StringComparison.OrdinalIgnoreCase); bool isTaskHostFactory = String.Equals(TaskFactoryAttributeName, TaskHostFactory, StringComparison.OrdinalIgnoreCase); - _taskFactoryParameters ??= new(); - TaskFactoryParameters.Add(Constants.TaskHostExplicitlyRequested, isTaskHostFactory.ToString()); + _taskFactoryParameters ??= []; + + if (isTaskHostFactory) + { + TaskFactoryParameters.Add(Constants.TaskHostExplicitlyRequested, isTaskHostFactory.ToString()); + } if (isAssemblyTaskFactory || isTaskHostFactory) { From 778927c778a667fb2991be675a64c30c50c9c96c Mon Sep 17 00:00:00 2001 From: Chet Husk Date: Mon, 20 Oct 2025 22:32:54 -0500 Subject: [PATCH 7/8] react to api change in testenvironment --- src/Build.UnitTests/NetTaskHost_E2E_Tests.cs | 2 +- src/UnitTests.Shared/TestEnvironment.cs | 5 ----- 2 files changed, 1 insertion(+), 6 deletions(-) diff --git a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs index 021e2d0795a..53a9094d775 100644 --- a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs +++ b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs @@ -138,7 +138,7 @@ public void MSBuildTaskInNetHostTest() [WindowsFullFrameworkOnlyFact] public void NetTaskWithImplicitHostParamsTest() { - using TestEnvironment env = TestEnvironment.Create(_output, setupDotnetEnvVars: true); + using TestEnvironment env = TestEnvironment.Create(_output); var bootstrapCorePath = Path.Combine(RunnerUtilities.BootstrapRootPath, "core", Constants.DotnetProcessName); string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj"); diff --git a/src/UnitTests.Shared/TestEnvironment.cs b/src/UnitTests.Shared/TestEnvironment.cs index 41abc59dce8..1525ccbfa94 100644 --- a/src/UnitTests.Shared/TestEnvironment.cs +++ b/src/UnitTests.Shared/TestEnvironment.cs @@ -56,11 +56,6 @@ public partial class TestEnvironment : IDisposable /// (MSBuild_*.txt) in the temp directory and treats their presence as test failures. /// Set to true to disable this monitoring for tests that expect build failures. /// - /// - /// When true, configures .NET-specific environment variables including PATH, - /// DOTNET_ROOT, and DOTNET_HOST_PATH to point to the bootstrap .NET installation. - /// This ensures tests use the correct .NET runtime and SDK versions. - /// /// /// A configured TestEnvironment instance with the specified settings applied. /// From fc0a54eb7ffe4db641b92e84827a80b42365995c Mon Sep 17 00:00:00 2001 From: YuliiaKovalova Date: Tue, 21 Oct 2025 10:39:41 +0200 Subject: [PATCH 8/8] fix the expected dotnet process path --- src/Build.UnitTests/NetTaskHost_E2E_Tests.cs | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs index 53a9094d775..195fcae8edc 100644 --- a/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs +++ b/src/Build.UnitTests/NetTaskHost_E2E_Tests.cs @@ -139,7 +139,7 @@ public void MSBuildTaskInNetHostTest() public void NetTaskWithImplicitHostParamsTest() { using TestEnvironment env = TestEnvironment.Create(_output); - var bootstrapCorePath = Path.Combine(RunnerUtilities.BootstrapRootPath, "core", Constants.DotnetProcessName); + var dotnetPath = env.GetEnvironmentVariable("DOTNET_ROOT"); string testProjectPath = Path.Combine(TestAssetsRootPath, "ExampleNetTask", "TestNetTaskWithImplicitParams", "TestNetTaskWithImplicitParams.csproj"); @@ -152,7 +152,7 @@ public void NetTaskWithImplicitHostParamsTest() successTestTask.ShouldBeTrue(); testTaskOutput.ShouldContain($"The task is executed in process: dotnet"); - testTaskOutput.ShouldContain($"Process path: {bootstrapCorePath}", customMessage: testTaskOutput); + testTaskOutput.ShouldContain($"Process path: {dotnetPath}", customMessage: testTaskOutput); testTaskOutput.ShouldContain("/nodereuse:False"); } }