I'm trying to set a default value for an MSBuild property. Say I start with this:
<Choose>
<When Condition="..something..">
<PropertyGroup>
...
<MySetting>true</MySetting>
<PropertyGroup>
</When>
...
</Choose>
If the condition is not true, then MySetting will be ''. So shouldn't this set it to false?
<PropertyGroup>
<MySetting Condition="'$(MySetting)'==''">false</MySetting>
</PropertyGroup>
Later on, I'd like to use MySetting in a conditional without having to test for =='true', like this:
<PropertyGroup Condition="$(MySetting)">
...
</PropertyGroup>
Yet when I load this project into Visual Studio it complains that the specified condition "$(MySetting)" evaluates to "" instead of a boolean.
So it appears that either my condition that checks for '' to assign the property to false is incorrect. What am I doing wrong?