Skip to content

Default to enumerating "MSBuild" processes#13501

Merged
SimaTian merged 1 commit intodotnet:vs18.6from
rainersigwald:vs-node-shutdown
Apr 8, 2026
Merged

Default to enumerating "MSBuild" processes#13501
SimaTian merged 1 commit intodotnet:vs18.6from
rainersigwald:vs-node-shutdown

Conversation

@rainersigwald
Copy link
Copy Markdown
Member

@rainersigwald rainersigwald commented Apr 7, 2026

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.exe processes 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.

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.
@rainersigwald rainersigwald requested a review from a team as a code owner April 7, 2026 19:58
Copilot AI review requested due to automatic review settings April 7, 2026 19:58
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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.MSBuildAppName when expectedProcessName would otherwise be null during process enumeration.
  • Bump VersionPrefix from 18.6.0 to 18.6.1 for 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.

@JanProvaznik
Copy link
Copy Markdown
Member

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants