Can someone help me understand Property Condition usage a bit better?

Answered Can someone help me understand Property Condition usage a bit better?

  • Thursday, March 01, 2012 2:40 PM
     
      Has Code

    I see many examples of Property elements being using a syntax like the following:

        <AfterAddIisSettingAndFileContentsToSourceManifest Condition="'$(AfterAddIisSettingAndFileContentsToSourceManifest)'==''">
              $(AfterAddIisSettingAndFileContentsToSourceManifest);
              SetCustomACLs;
        </AfterAddIisSettingAndFileContentsToSourceManifest>
    
    

    What I don't understand is this,  if the Condition just verified that the property is not set,

    '$(AfterAddIisSettingAndFileContentsToSourceManifest)'==''

    then why bother calling the property?

    '$(AfterAddIisSettingAndFileContentsToSourceManifest);

All Replies

  • Friday, March 02, 2012 2:32 AM
    Moderator
     
     Answered

    Hi Hugh

    Based on above code, it seems to define a propery with a condition to check if it is defined before. If it is not defined, set it as SetCusyomACLs.

    I agree with you, the $(AfterAddIisSettingAndFileContentsToSourceManifest); seems useless in the property defination depends on above code only.

    Regards,

    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us

  • Wednesday, March 07, 2012 6:53 AM
    Moderator
     
     

    Hi,

    I am writing to check the status of the issue on your side.  Would you mind letting us know the result of the suggestions? 

    Yi


    Yi Feng Li [MSFT]
    MSDN Community Support | Feedback to us

  • Wednesday, March 07, 2012 12:17 PM
     
     

    I think you've answered my question.   I was ultimately able to follow the breadcrumbs all the way from my initial .csproj file to my .wpp.targets file and now have at least a fuzzy idea of how it all connects.