Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Conversation

@pull
Copy link

@pull pull bot commented Nov 10, 2025

See Commits and Changes for more details.


Created by pull[bot] (v2.0.0-alpha.4)

Can you help keep this open source service alive? πŸ’– Please sponsor : )

YuliiaKovalova and others added 4 commits November 10, 2025 10:08
This change introduces a new read only struct that is used in Dictionary
for caching in TaskRegistry
#12620


Without a proper equality check it spawns a new process due to mismatch.

Experimental insertion without extra allocation reported:
https://devdiv.visualstudio.com/DevDiv/_git/VS/pullrequest/686770
…12679)

## Summary: Add MSBUILDDEBUGONSTART=3 to skip debugging TaskHost
processes

βœ… **All tasks completed successfully**

- [x] Explore repository structure and understand current implementation
- [x] Understand how MSBUILDDEBUGONSTART works in XMake.cs and
OutOfProcTaskHost.cs
- [x] Identify that DebugUtils.cs has NodeMode detection capability
- [x] Build repository successfully to verify starting state
- [x] Create helper method IsInTaskHostNode() in DebugUtils.cs
- [x] Update XMake.cs to support new environment variable value "3"
(launches debugger conditionally)
- [x] Update OutOfProcTaskHost.cs to handle value "3" (skips debugging
for TaskHost)
- [x] Add tests for the new IsInTaskHostNode() method
- [x] Build and verify the changes work
- [x] Run tests to ensure no regressions
- [x] Manual verification of the feature
- [x] Code review and address feedback
- [x] **Fixed: Added IsInTaskHostNode() check in XMake.cs to handle
sidecar TaskHost processes**
- [x] **Updated documentation to reference new MSBUILDDEBUGONSTART=3
behavior**
- [x] CodeQL security scan
- [x] Final validation

## Changes Made (42 lines added/modified across 6 files):

1. **src/Shared/Debugging/DebugUtils.cs**: Added `IsInTaskHostNode()`
public method to detect if current process is a TaskHost
2. **src/MSBuild/XMake.cs**: Added case "3" with conditional check -
launches debugger only if NOT in TaskHost mode
3. **src/MSBuildTaskHost/OutOfProcTaskHost.cs**: Added case "3" to skip
debugger launch for TaskHost processes
4. **src/Build.UnitTests/BackEnd/DebugUtils_tests.cs**: Added test to
verify IsInTaskHostNode() works correctly
5.
**documentation/wiki/Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md**:
Updated debugging section with new value "3"
6.
**documentation/wiki/Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md**:
Updated breakpoints section with new value "3"

## How to Use:
Set `MSBUILDDEBUGONSTART=3` before running MSBuild to debug the main
process while skipping both:
- MSBuildTaskHost.exe child processes
- Sidecar TaskHost processes running in MSBuild.exe

**Available values:**
- `1`: Launch debugger for all processes (main + TaskHost)
- `2`: Wait for manual debugger attach for all processes  
- `3` (NEW): Launch debugger for main MSBuild only, skip TaskHost
processes

## Documentation:
βœ… Updated in two wiki pages:
- Building-Testing-and-Debugging-on-.Net-Core-MSBuild.md
- Building-Testing-and-Debugging-on-Full-Framework-MSBuild.md

## 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

<!-- START COPILOT CODING AGENT SUFFIX -->



<details>

<summary>Original prompt</summary>

> There is the MSBUILDDEBUGONSTART environment variable that launches
debugging at the start when set. However it launches it also for child
processes that inherit the environment (e.g. the Sidecar TaskHost
processes, which I don't want to debug every time). Please add a new
value for the variable that when set first checks if the current process
is a sidecar taskhost and in that case does not launch debugging.


</details>



<!-- START COPILOT CODING AGENT TIPS -->
---

πŸ’¬ Share your feedback on Copilot coding agent for the chance to win a
$200 gift card! Click
[here](https://survey3.medallia.com/?EAHeSx-AP01bZqG0Ld9QLQ) to start
the survey.

---------

Co-authored-by: copilot-swe-agent[bot] <[email protected]>
Co-authored-by: JanProvaznik <[email protected]>
This pull request updates the following dependencies

[marker]: <> (Begin:369b758c-dad8-4fea-810a-64fb6b0308e9)
## From https://github.com/dotnet/arcade
- **Subscription**:
[369b758c-dad8-4fea-810a-64fb6b0308e9](https://maestro.dot.net/subscriptions?search=369b758c-dad8-4fea-810a-64fb6b0308e9)
- **Build**:
[20251105.6](https://dev.azure.com/dnceng/internal/_build/results?buildId=2832312)
([289702](https://maestro.dot.net/channel/8394/github:dotnet:arcade/build/289702))
- **Date Produced**: November 6, 2025 12:10:41 AM UTC
- **Commit**:
[987d1a73ea67d323c0fc7537bce8ec65d87eb43f](dotnet/arcade@987d1a7)
- **Branch**:
[release/10.0](https://github.com/dotnet/arcade/tree/release/10.0)

[DependencyUpdate]: <> (Begin)

- **Dependency Updates**:
  - From [10.0.0-beta.25531.2 to 10.0.0-beta.25555.6][1]
     - Microsoft.DotNet.Arcade.Sdk
     - Microsoft.DotNet.XUnitExtensions

[1]: dotnet/arcade@fb1799f...987d1a7

[DependencyUpdate]: <> (End)

- **Updates to .NET SDKs:**
  - Updates **tools.dotnet** to 10.0.100-rc.1.25451.107

[marker]: <> (End:369b758c-dad8-4fea-810a-64fb6b0308e9)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
This pull request updates the following dependencies

[marker]: <> (Begin:8a4332aa-2543-4c51-b941-e73f31e22328)
## From https://github.com/dotnet/roslyn
- **Subscription**:
[8a4332aa-2543-4c51-b941-e73f31e22328](https://maestro.dot.net/subscriptions?search=8a4332aa-2543-4c51-b941-e73f31e22328)
- **Build**:
[20251109.1](https://dev.azure.com/dnceng/internal/_build/results?buildId=2834824)
([290087](https://maestro.dot.net/channel/548/github:dotnet:roslyn/build/290087))
- **Date Produced**: November 9, 2025 7:47:54 PM UTC
- **Commit**:
[b28fc311e384c959fba1fea1ede591a1552c2c1e](dotnet/roslyn@b28fc31)
- **Branch**: [main](https://github.com/dotnet/roslyn/tree/main)

[DependencyUpdate]: <> (Begin)

- **Dependency Updates**:
  - From [5.3.0-2.25551.1 to 5.3.0-2.25559.1][1]
     - Microsoft.Net.Compilers.Toolset

[1]: dotnet/roslyn@f695099...b28fc31

[DependencyUpdate]: <> (End)


[marker]: <> (End:8a4332aa-2543-4c51-b941-e73f31e22328)

Co-authored-by: dotnet-maestro[bot] <dotnet-maestro[bot]@users.noreply.github.com>
@pull pull bot locked and limited conversation to collaborators Nov 10, 2025
@pull pull bot merged commit a110114 into thompson-tomo:main Nov 10, 2025
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant