Repository navigation
Honor MSBuild -mt in dotnet run preparation - #56837
Open
jonathanpeppers wants to merge 3 commits into
Open
jonathanpeppers wants to merge 3 commits into
jonathanpeppers wants to merge 3 commits into
Conversation
Apply the parsed -mt setting to restore, device discovery, deployment, and run-argument target calls. Preserve the existing single-node and per-call build behavior. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
|
Azure Pipelines: Successfully started running 2 pipeline(s). 1 pipeline(s) were filtered out due to trigger conditions. There may be pipelines that require an authorized user to comment /azp run to run. |
Contributor
There was a problem hiding this comment.
🟡 Changes recommended
Tests do not verify project preparation build modes under response files, explicit overrides, and environment settings, or file-based --no-build evaluation modes and resulting launch properties.
2 open issues
What changed in this PR
This PR makes dotnet run preparation targets honor the parsed MSBuild -mt setting while retaining their single-node limit.
Changes:
- Shares the existing file-based concurrency parser across run preparation paths.
- Uses an explicit build helper to apply multithreading to preparation targets.
- Adds regression cases for enabled, disabled, default, and
--no-buildbehavior.
| File | Description |
|---|---|
test/dotnet.Tests/CommandTests/Run/GivenDotnetRunSelectsDevice.cs |
Adds binlog assertions for preparation targets’ multithreading mode. |
src/Cli/dotnet/Commands/Run/VirtualProjectBuildingCommand.cs |
Reuses the extracted concurrency parser. |
src/Cli/dotnet/Commands/Run/RunCommandSelector.cs |
Applies parsed multithreading to restore and device targets. |
src/Cli/dotnet/Commands/Run/RunCommand.cs |
Applies parsed multithreading to ComputeRunArguments. |
src/Cli/dotnet/Commands/Run/CommonRunHelpers.cs |
Hosts shared concurrency parsing and single-node build execution. |
Review effort: Balanced
jjonescz
reviewed
Oct 29, 2026
Member
Author
|
@jjonescz sorry, copilot opened this without me doing a full review -- I'll take it to draft, until I finish |
jonathanpeppers
marked this pull request as draft
October 29, 2026 15:54
Member
|
FWIW, it seems my questions apply to code that was merely moved, not added, but I don't think I have reviewed the code previously, so I still have those questions :) |
Reuse the switch helper from CoreUtils instead of running the full MSBuild parser for preparation calls. Leave file-based build parsing unchanged and cover file-based no-build target execution. Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
Co-authored-by: Copilot App <223556219+Copilot@users.noreply.github.com>
This branch has not been 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.

dotnet run -mtenables multithreading for the main build, but the separate preparation calls usedProjectInstance.Buildwithout applying that setting.Apply the MT setting to
Restore,ComputeAvailableDevices,DeployToDevice, andComputeRunArguments, including file-based runs that need to evaluate run arguments with--no-build. Keep the existing single-node limit, build lifetimes, logging, and target-produced project state.Parse explicit MT switches in
MSBuildArgs, reusing the switch helper moved toCli.CoreUtils. Preserve boolean values, duplicate-switch precedence, and environment defaults without invoking the full MSBuild parser for preparation calls. Automatic response-file discovery is not added to those calls; the existing file-based build parser is unchanged.Add focused parser and preparation tests, including a file-based
--no-buildtest that checks MT mode and use of target-produced launch arguments. Document-mtand-mfor file-based MSBuild builds.Validation:
--no-build -mt:falsedid not.