Skip to content

Quote arguments to [MSBuild]::MakeRelative#53446

Merged
marcpopMSFT merged 5 commits intodotnet:release/10.0.2xxfrom
rainersigwald:quote-makerelative
Mar 24, 2026
Merged

Quote arguments to [MSBuild]::MakeRelative#53446
marcpopMSFT merged 5 commits intodotnet:release/10.0.2xxfrom
rainersigwald:quote-makerelative

Conversation

@rainersigwald
Copy link
Copy Markdown
Member

Fix #53385 by quoting file-path arguments so any commas within the paths
do not leak into MSBuild's understanding of the arguments to the
property function.

Fixes #53385

Summary

Customers with Content items that had commas in the filenames hit build/publish failures.

Customer Impact

Build failures on update to 10.0.200.

Regression?

Yes, from #52275.

Testing

Privates tested against repro project from #53385 (comment).

Risk

Low -- quoting arguments following the pattern used elsewhere.

Fix dotnet#53385 by quoting file-path arguments so any commas within the paths
do not leak into MSBuild's understanding of the arguments to the
property function.
@rainersigwald rainersigwald requested review from a team as code owners March 13, 2026 19:29
Copilot AI review requested due to automatic review settings March 13, 2026 19:29
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

Fixes publish/build failures when Content item paths contain commas by ensuring MSBuild parses [MSBuild]::MakeRelative arguments correctly (addresses regression from #52275 / issue #53385).

Changes:

  • Quote both arguments passed to $([MSBuild]::MakeRelative(...)) when computing Content TargetPath during publish item collection.

This test verifies that Content items with commas in their filenames can be published without triggering MSB4186 due to the comma being interpreted as an argument separator.
@marcpopMSFT
Copy link
Copy Markdown
Member

@JanKrivanek @baronfel I copied the test from the other PR but looks like it was missing something. If y'all want to prep for tactics while I'm out, please do. If not, I'll get to it Monday.

@baronfel
Copy link
Copy Markdown
Member

The errors were a test arrangement change, fixed that up and things seem to be ready to go for Tactics consideration.

@marcpopMSFT
Copy link
Copy Markdown
Member

New test failed, will need to investigate.
[xUnit.net 00:00:43.73] C:\h\w\AC3C097B\p\d\sdk\10.0.202-ci\Sdks\Microsoft.NET.Sdk\targets\Microsoft.NET.Publish.targets(428,5): error MSB3030: Could not copy the file "C:\h\w\AC3C097B\t\dotnetSdkTests\iinx3vxp.rdv\It_publishes_---8143E28C\PublishCommaContent\Doto-VariableFont_ROND,cwght.ttf" because it was not found.

@cmerighi
Copy link
Copy Markdown

If it was meant for 10.0.202, then it's clearly not fixed. Otherwise, we cross our fingers for the next version.

@cmerighi
Copy link
Copy Markdown

Not fixed in 10.0.203 either. This is becoming quite frustrating...

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

Projects

None yet

Development

Successfully merging this pull request may close these issues.

7 participants