Skip to content

Do not overwrite GetCopyToOutputDirectoryItemsDependsOn, just add new…#13474

Open
snechaev wants to merge 1 commit intodotnet:mainfrom
snechaev:fix-13471
Open

Do not overwrite GetCopyToOutputDirectoryItemsDependsOn, just add new…#13474
snechaev wants to merge 1 commit intodotnet:mainfrom
snechaev:fix-13471

Conversation

@snechaev
Copy link
Copy Markdown

… values.

Fixes #13471

Context

The value of the GetCopyToOutputDirectoryItemsDependsOn parameter was being overwritten, which made it difficult to add custom targets at a specific build stage.

Changes Made

Overwrite the whole value was replaced by adding the new items to the existing value.

Testing

Notes

Copilot AI review requested due to automatic review settings March 31, 2026 15:09
Copy link
Copy Markdown
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull request overview

This PR fixes MSBuild extensibility for GetCopyToOutputDirectoryItemsDependsOn by preserving any pre-existing (user- or import-provided) value instead of overwriting it in Microsoft.Common.CurrentVersion.targets, aligning it with the established “append-to-DependsOn property” pattern used elsewhere in the file.

Changes:

  • Prepend $(GetCopyToOutputDirectoryItemsDependsOn); to the default dependency list so customizations aren’t lost.
  • Enables users to insert custom targets at a specific stage of GetCopyToOutputDirectoryItems execution (per #13471).

@rainersigwald rainersigwald self-assigned this Apr 6, 2026
Copy link
Copy Markdown
Member

@rainersigwald rainersigwald left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks @snechaev!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

GetCopyToOutputDirectoryItemsDependsOn overwrites previous value instead of appending to it

3 participants