Wrong evaluation of conditional properties
See original GitHub issueI 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:
- Created 5 years ago
- Comments:14 (8 by maintainers)
Top 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 >Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start FreeTop Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found
Top GitHub Comments
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
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.