When an undefined property is used, consider logging a warning or at least a message. In Strict Mode, fail the build.
Such a warning would be _incredibly_ noisy.
It would also have to be special cased for the if-not-set-set-to-my-default case
<PropertyGroup>
<FunProperty Condition="'$(FunProperty)' == ''">FunDefault</FunProperty>
</PropertyGroup>
I think we already have logic to detect that case somewhere, but I don't remember why . ..
You can make a differentiation between when it's used directly like in '$(FunProperty)' or in expression '$(FunProperty)\foo'.
Better pattern to check is property was defined might also help
yeah like we have Exists for files and directories, have Defined for properties.
<PropertyGroup>
<FunProperty Condition="!Defined(FunProperty)">FunDefault</FunProperty>
</PropertyGroup>
See related https://github.com/microsoft/msbuild/issues/5015
This can be enabled with MSBUILDWARNONUNINITIALIZEDPROPERTY. I presume it wasn't made default when that was implemented in the Stone Age because of noisiness (but we can always reevaluate).
Most helpful comment
yeah like we have
Existsfor files and directories, haveDefinedfor properties.