Restore Arcade's Build.proj and remove Tools.proj - #7491
Draft
ViktorHofer wants to merge 1 commit into
Draft
ViktorHofer wants to merge 1 commit into
ViktorHofer wants to merge 1 commit into
Conversation
Pass the /restore flag to the msbuild process invocation so that the toolset Build.proj gets restored. With that, the separate Tools.proj restore invocation isn't necessary and with that, the toolset restore happens immediately.
ViktorHofer
added a commit
to dotnet/msbuild
that referenced
this pull request
Jun 30, 2026
…metaproject MSB4057 in parallel builds (#14223) Unblocks dotnet/dotnet#7491 ### Summary Fixes a bug where building a solution that requests a non-default target (e.g. `Pack`) fails with `MSB4057: The target "Pack" does not exist in the project` in **parallel / multithreaded** builds, while the same build succeeds serially. This was observed building the `dotnet/dotnet` VMR (Arcade builds the solution in two phases with different `__BuildPhase` global properties; the `SolutionBuild` phase requests `Build;Pack`). ### Root cause `BuildRequestConfiguration.RequestedTargets` was a get-only auto-property that was **never serialized** in `Translate`. In parallel/MT builds the configuration is round-tripped through translation (even when the work appears to run in-proc on node 1), so the deserialized configuration reset `RequestedTargets` to an empty collection. `SolutionProjectGenerator` only emits user-requested targets (such as `Pack`) into the generated `.slnx.metaproj` when they are present in `config.RequestedTargets`. With an empty set, `Pack` was omitted from the metaproject and the build failed with `MSB4057`. Serial builds never serialized the configuration, so they were unaffected. ### Fix Back `RequestedTargets` with a `List<string>` field and translate it in `BuildRequestConfiguration.Translate`. ### Validation Reproduced end-to-end against the `dotnet/dotnet` VMR (`symreader`). A/B with patched MSBuild deployed into the VMR SDK: | Serialization | targets reaching `SolutionBuild` generation | Result | | --- | --- | --- | | disabled (before) | `[]` | metaproject lacks `Pack` -> **MSB4057** | | enabled (this fix) | `[Build;Pack]` | metaproject contains `Pack` -> **build succeeds** | Added regression test `TestTranslationPreservesRequestedTargets`; full `*TestTranslation*` suite passes (56/56, net10.0 + net472). --------- Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
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.
Pass the /restore flag to the msbuild process invocation so that the toolset Build.proj gets restored. With that, the separate Tools.proj restore invocation isn't necessary and with that, the toolset restore happens immediately.
Blocked on dotnet/msbuild#14223 - until the change is consumed in an SDK re-boostrap and until VS images are updated and include the change. I opened this PR now to link to it from the msbuild change and to save the changes somewhere.