Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix property expander when comparing between non-numeric and numeric properties #10696

Open
wants to merge 1 commit into
base: main
Choose a base branch
from

Conversation

JaynieBai
Copy link
Member

@JaynieBai JaynieBai commented Sep 24, 2024

Fixes #10583

Context

Can't evaluate

    <PropertyGroup>
      <Foo>Foo</Foo>

      <!-- This has to be numeric. -->
      <Bar>1234</Bar>

      <!-- This is a workaround. -->
      <Good>$([System.String]::Equals($(Foo), $(Bar)))</Good>

      <!-- This works on .NET 7 but on 8 it doesn't. -->
      <Bad>$(Foo.Equals($(Bar)))</Bad>
    </PropertyGroup>

Changes Made

Use the double.TryParse instead of the convert method

Testing

Add the test cases in the test method Medley()

Notes

@JaynieBai JaynieBai marked this pull request as ready for review September 24, 2024 10:31
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.

[Bug]: MSB4184 while evaluating an expression in property setter
2 participants