Fix unresolved P2P references losing Configuration in solution builds#13458
Fix unresolved P2P references losing Configuration in solution builds#13458jimpark wants to merge 7 commits intodotnet:mainfrom
Conversation
There was a problem hiding this comment.
Pull request overview
This PR addresses solution-build project-reference configuration propagation by changing how AssignProjectConfiguration handles unresolved P2P references, so referenced projects no longer lose the parent Configuration/Platform in solution builds (gated behind ChangeWave 18.6).
Changes:
- Gate the unresolved-reference
GlobalPropertiesToRemove=Configuration;Platformbehavior behind ChangeWave 18.6 (old behavior only when 18.6 is disabled). - Add unit tests validating the new ChangeWave 18.6 behavior for unresolved references and configuration names containing spaces.
- Document the new ChangeWave 18.6 entry in
ChangeWaves.md.
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 2 comments.
| File | Description |
|---|---|
| src/Tasks/AssignProjectConfiguration.cs | Stops stripping Configuration/Platform for unresolved solution references when ChangeWave 18.6 is enabled. |
| src/Tasks.UnitTests/AssignProjectConfigurationChangeWave_Tests.cs | Adds targeted tests around the ChangeWave 18.6 behavior and config/platform metadata handling. |
| documentation/wiki/ChangeWaves.md | Adds ChangeWave 18.6 documentation entry for this behavior change. |
Co-authored-by: Copilot <175728472+Copilot@users.noreply.github.com>
|
@dotnet-policy-service agree |
|
CI failures in
The failures rotate between platforms with identical code. All failures are in Retriggered CI — happy to retrigger again if needed. |
Fixes #13453
Context
When building a solution, AssignProjectConfiguration sets
GlobalPropertiesToRemove=Configuration;Platform on project references
not found in the .sln file. This strips Configuration from child
projects, causing them to fall back to their default (typically "Debug")
instead of inheriting the parent's configuration. This breaks any
solution where ProjectReference targets exist outside the solution and
the active configuration differs from the child's default — most
visibly with custom C++ configurations like "Debug Unicode".
Changes Made
Under ChangeWave 18.6, unresolved references no longer have
Configuration and Platform added to GlobalPropertiesToRemove. Child
projects inherit these properties from the parent's global properties,
matching the existing behavior for non-solution builds.
src/Tasks/AssignProjectConfiguration.cs— Gate theGlobalPropertiesToRemove logic behind ChangeWave 18.6
documentation/wiki/ChangeWaves.md— Document the new entryTesting
covering unresolved references with and without the ChangeWave,
resolved references with spaces in configuration names, and
preservation of pre-existing GlobalPropertiesToRemove metadata.
still pass.
Notes
This is a behavioral change gated behind ChangeWave 18.6. Users who
rely on unresolved references building with their default configuration
can opt out by setting MSBuildDisableFeaturesFromVersion=18.6.