Default to enumerating "MSBuild" processes#13501
Merged
SimaTian merged 1 commit intodotnet:vs18.6from Apr 8, 2026
Merged
Conversation
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.
ViktorHofer
approved these changes
Apr 7, 2026
baronfel
approved these changes
Apr 7, 2026
Contributor
There was a problem hiding this comment.
Pull request overview
Fixes BuildManager.ShutdownAllNodes() behavior by ensuring that, on .NET Framework, out-of-proc node discovery defaults to enumerating MSBuild processes when the expected process name can’t be derived (preventing VS shutdown from leaving idle MSBuild.exe processes behind).
Changes:
- Add a .NET Framework-only fallback to use
Constants.MSBuildAppNamewhenexpectedProcessNamewould otherwise be null during process enumeration. - Bump
VersionPrefixfrom18.6.0to18.6.1for servicing.
Reviewed changes
Copilot reviewed 2 out of 2 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
src/Build/BackEnd/Components/Communications/NodeProviderOutOfProcBase.cs |
Ensures idle node shutdown can still find candidates on .NET Framework by defaulting to MSBuild process enumeration when the derived name is null. |
eng/Versions.props |
Servicing version bump to 18.6.1. |
Member
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fixes devdiv2860587
Summary
Fixes the
BuildManager.ShutdownAllNodes()API used to close MSBuild at VS shutdown.Customer Impact
VS didn't clean up after itself and left
MSBuild.exeprocesses idle after shutdown.Regression?
Yes, worked in 18.5.
Testing
Manual validation of fix.
Risk
Low. This API is used when acquiring (existing) nodes, but that codepath always passed in enough information to avoid the bug.