question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Wrong evaluation of conditional properties

See original GitHub issue

I stumbled across a problem in a fairly complex project with conditional properties. Unfortunalty I do not have a simplified project to reproduce this issue but when I find some time I will try to set one up.

The issue boils down to a property sheet defining a property like this

<Choose>  
  <When Condition=some_cond>
    <PropertyGroup>
      <P1>Foo</P1>
    </PropertyGroup>
  </When>
  <Otherwise>
    <PropertyGroup>
      <P1>Bar</P1>
    </PropertyGroup>
  </Otherwise>
</Choose>

If the condition is true everything works fine but when the condition is evaluated to false it seems that in SanitizeProjectNode the when node is scheduled for deletion but before this is done the Otherwise node is evaluated and discarded because the when node is still present. The attached diff fixes the issue for me but I wonder if this might break other thing I did not find yet. delay_node_process_diff.txt

Issue Analytics

  • State:closed
  • Created 5 years ago
  • Comments:14 (8 by maintainers)

github_iconTop GitHub Comments

1reaction
mkaescommented, Mar 26, 2019

I finally was able to make an example project. It is possible to build the x86 and x64 config with visual studio but the clang tools always take the wrong condition. In this case a non valid path and thus a compile error. I hope this helps. PropsTest.zip

1reaction
mkaescommented, Mar 26, 2019

It still does not work with the 4.10 version without my patch. So I guess there is still something wrong. I was not yet able to strip our build system to an easily debuggable example. But as soon as I understand msbuild good enough to do so, I will reopen this bug.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Conditional breakpoint fails to evaluate a string property
The condition for a breakpoint failed to execute. The condition was 'item.No == "xxx"'. The error returned was 'Evaluation of method System.
Read more >
c# - Will an IF statement stop evaluating if it fails the first ...
It will stop evaluating because you're using the double ampersand && operator. This is called short-circuiting. it would evaluate both. If you ...
Read more >
Conditional attribute evaluation one input, depending on ...
My understanding is I use an AttributeManager (I could be wrong) and that I can somehow create a condition that will produce different...
Read more >
Conditional Object Properties Using Spread in JavaScript
Please note that spread only ignores false when it's being spread into an object. This will throw an error if you attempt to...
Read more >
17.6: Truth Tables: Conditional, Biconditional
In traditional logic, a conditional is considered true as long as there are no cases in which the antecedent is true and the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found