Skip to content

Property functions with a single _ as an argument return bad results #10435

@rainersigwald

Description

@rainersigwald
<Project>
    <Target Name="Go">
      <Warning Text="Surprise! $([System.String]::Join('_', 'asdf', 'jkl'))" />
    </Target>
</Project>

New:

artifacts\bin\bootstrap\net472\MSBuild\Current\Bin\MSBuild.exe .\foo.proj -tl:false
MSBuild version 17.12.0-dev-24373-01+9f69926a2 for .NET Framework

S:\msbuild\foo.proj(18,7): warning : Surprise!

Expected:

msbuild .\foo.proj -tl:false
MSBuild version 17.12.0-preview-24367-07+486dbb4a9 for .NET Framework


S:\msbuild\foo.proj(18,7): warning : Surprise! asdf_jkl

This is the root cause of errors in dotnet/sdk#42258 because of https://github.com/dotnet/wpf/blob/d21766ccfcdeb05aa3feeb6a195c01dbf2e1a5fb/src/Microsoft.DotNet.Wpf/src/PresentationBuildTasks/Microsoft.WinFX.targets#L376 and was introduced by 9f69926, specifically

if (args.Any(a => "_".Equals(a)))

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions