-
Couldn't load subscription status.
- Fork 1.4k
Add MSBUILDDEBUGONSTART=3 to skip debugging TaskHost child processes #12679
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
Co-authored-by: JanProvaznik <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
Adds support for MSBUILDDEBUGONSTART=3 to launch the debugger only for the main MSBuild process while skipping TaskHost processes. Key changes introduce a detection helper (IsInTaskHostNode), conditional debugger launch logic in XMake, a no-op case in OutOfProcTaskHost, and updated documentation plus a unit test.
- Added IsInTaskHostNode() to identify TaskHost context.
- Added case "3" handling in XMake.cs and OutOfProcTaskHost.cs.
- Updated docs and added a single test for the new helper.
Reviewed Changes
Copilot reviewed 6 out of 6 changed files in this pull request and generated 1 comment.
Show a summary per file
| File | Description |
|---|---|
| src/Shared/Debugging/DebugUtils.cs | Adds IsInTaskHostNode() helper for node mode detection used by debugger logic. |
| src/MSBuild/XMake.cs | Adds conditional debugger launch for value "3" skipping TaskHost nodes. |
| src/MSBuildTaskHost/OutOfProcTaskHost.cs | Adds case "3" that intentionally skips launching debugger in TaskHost. |
| src/Build.UnitTests/BackEnd/DebugUtils_tests.cs | Adds unit test covering false (central node) case of IsInTaskHostNode(). |
| documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md | Documents new MSBUILDDEBUGONSTART=3 behavior. |
| documentation/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md | Documents new MSBUILDDEBUGONSTART=3 usage. |
Summary: Add MSBUILDDEBUGONSTART=3 to skip debugging TaskHost processes
✅ All tasks completed successfully
Changes Made (42 lines added/modified across 6 files):
IsInTaskHostNode()public method to detect if current process is a TaskHostHow to Use:
Set
MSBUILDDEBUGONSTART=3before running MSBuild to debug the main process while skipping both:Available values:
1: Launch debugger for all processes (main + TaskHost)2: Wait for manual debugger attach for all processes3(NEW): Launch debugger for main MSBuild only, skip TaskHost processesDocumentation:
✅ Updated in two wiki pages:
Security:
✅ No security vulnerabilities detected by CodeQL
Testing:
✅ All tests pass (2/2 DebugUtils tests)
✅ Build succeeds with no warnings or errors
✅ Manual verification completed
Original prompt
💬 Share your feedback on Copilot coding agent for the chance to win a $200 gift card! Click here to start the survey.