Repository navigation
Add server-only MSBUILDDEBUGONSTART modes - #14988
Merged
Merged
Conversation
Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Copilot-Session: 54b82003-8c38-401d-bf86-b87943e67ae2
JanProvaznik
temporarily deployed
to
copilot-pat-pool
September 9, 2026 13:55 — with
GitHub Actions
Inactive
JanProvaznik
temporarily deployed
to
copilot-pat-pool
September 9, 2026 13:55 — with
GitHub Actions
Inactive
JanProvaznik
had a problem deploying
to
copilot-pat-pool
September 9, 2026 13:56 — with
GitHub Actions
Failure
Contributor
There was a problem hiding this comment.
🟢 Approval recommended
The changes are opt-in, correctly gated to server nodes, and include focused tests plus documentation updates aligning with the stated compatibility goals.
Pull request overview
This PR refines MSBUILDDEBUGONSTART for MSBuild Server debugging by adding server-only modes that avoid pausing the forwarding client (which can otherwise trigger connection-timeout fallback) and instead pause/launch the debugger in the server process at a safe point (after client connection, before evaluation), including for reused servers.
Changes:
- Add
MSBUILDDEBUGONSTART=4(server-only debugger launch) and=5(server-only “print PID + wait for attach”) toXMake.DebuggerLaunchCheck. - Add targeted unit tests validating that modes 4/5 don’t affect in-proc builds and that mode 5 blocks before evaluation for cold and warm servers.
- Document the new modes and recommended usage patterns in the wiki pages.
File summaries
| File | Description |
|---|---|
| src/MSBuild/XMake.cs | Adds server-only debug modes 4 (launch) and 5 (wait-for-attach) gated on s_isServerNode. |
| src/MSBuild.UnitTests/MSBuildServer_Tests.cs | Adds focused tests for server-only debug modes, including warm-server reuse coverage. |
| documentation/wiki/MSBuild-Environment-Variables.md | Documents modes 4/5 behavior, scope, and operational caveats. |
| documentation/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md | Adds a dedicated “Debugging MSBuild Server” section with example usage. |
Review details
- Files reviewed: 4/4 changed files
- Comments generated: 0
- Review effort level: Lite
💡 Add a code-review agent skill for context-aware, tailored reviews. Learn more in the docs.
JanProvaznik
temporarily deployed
to
copilot-pat-pool
September 9, 2026 14:31 — with
GitHub Actions
Inactive
JanProvaznik
temporarily deployed
to
copilot-pat-pool
September 9, 2026 14:32 — with
GitHub Actions
Inactive
JanProvaznik
temporarily deployed
to
copilot-pat-pool
September 9, 2026 14:33 — with
GitHub Actions
Inactive
rainersigwald
approved these changes
Sep 9, 2026
This was referenced Sep 9, 2026
This was referenced Nov 11, 2026
Merged
Closed
This was referenced Nov 15, 2026
Open
Closed
Closed
chore(deps): Bump the nuget-dependencies group with 10 updates
JerrettDavis/JD.MSBuild.Containers#50
Open
Open
This branch was previously deployed
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.
Context
MSBUILDDEBUGONSTARTstops the forwarding client and can pause a new server long enough to trigger connection-timeout fallback. Debugging should target the process performing the build instead.Changes Made
Add server-only modes:
4launches a debugger;5prints the server PID and waits for attachment. Both use the existing hook after connection and before evaluation, including on reused servers. Production change: 11 lines, plus focused tests and documentation.Compatibility
Values 1-3, connection timeouts, cancellation, fallback, APIs, and protocols are unchanged. These modes do not enable Server or cover early startup/handshake debugging; abandoning a wait requires manually resuming or stopping the server.
Testing
Four focused
ServerOnlyDebugging*cases passed on both .NET 11 and .NET Framework 4.7.2: in-process skipping and cold/warm server waits. Manual server debugging also confirmed locally. Non-Windows execution was not exercised.