From 4af12bf9819337a0ca51e91356c77b3d73f822fa Mon Sep 17 00:00:00 2001 From: Rainer Sigwald Date: Tue, 7 Apr 2026 14:49:10 -0500 Subject: [PATCH] Default to enumerating "MSBuild" processes On Visual Studio shutdown, it calls `BuildManager.ShutdownAllNodes()` to close MSBuild worker nodes as `devenv.exe` is shutting down. That in turn calls `GetPossibleRunningNodes()` (no optional args), to find nodes to connect to, in order to send them the shutdown signal. Immediately prior to this change, that call was failing because `isNativeHost` was false and `CurrentHost.GetCurrentHost` is hardcoded to return `null` on .NET Framework, so we searched for processes with a null input and got none back to signal. Instead, if we don't have anything better to search for on .NET Framework, search for "MSBuild" processes, which will cover worker nodes running in .NET Framework. --- eng/Versions.props | 2 +- .../Components/Communications/NodeProviderOutOfProcBase.cs | 6 ++++++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/eng/Versions.props b/eng/Versions.props index 9fff248d547..efa0f034ce6 100644 --- a/eng/Versions.props +++ b/eng/Versions.props @@ -3,7 +3,7 @@ - 18.6.0release + 18.6.1release servicing 18.5.0-preview-26126-01 15.1.0.0 diff --git a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs index 95cf4815134..360b60d70b8 100644 --- a/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs +++ b/src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs @@ -475,6 +475,12 @@ void CreateNodeContext(int nodeId, Process nodeToReuse, Stream nodeStream, byte bool isNativeHost = msbuildLocation != null && Path.GetFileName(msbuildLocation).Equals(Constants.MSBuildExecutableName, StringComparison.OrdinalIgnoreCase); string expectedProcessName = Path.GetFileNameWithoutExtension(isNativeHost ? msbuildLocation : (CurrentHost.GetCurrentHost() ?? msbuildLocation)); +#if NETFRAMEWORK + // Fall back to the standard executable name for most nodes + // on .NET Framework, to function in `ShutdownAllNodes()` + expectedProcessName ??= Constants.MSBuildAppName; +#endif + Process[] processes; try {