Question

In MsBuild, is it possible to create an MSBuild condition (or another situation) that will evaluate whether a Property is 'defined' (presuming that this is previous to assigning the property a value somewhere)?

The following seems a little too clumsy to be reliable:

<PropertyGroup Label="Undefined State">
     <Defined></Defined>
</PropertyGroup>

<Choose>
   <When Condition="('$(Defined)' == '' OR '$(Defined)' != '')">
        <Message Text="Defined is probably/likely/assuredly defined"/>
    </When>
    <Otherwise>
       <Message Text="Defined is reportedly/maybe/possibly not defined"/>
    </Otherwise>
<Choose>

No correct solution

Licensed under: CC-BY-SA with attribution
Not affiliated with StackOverflow
scroll top