Feature Request: Condition Attribute on ItemMetaData Element

I would like to be able to pass meta data based on a condition.  At present, as far as I know, I have to do this:

 <ItemGroup>
  <Compile Include="MyClass.boo" Condition='$(Configuration)' == 'Debug'>
   <DefineConstants" >OnForThisFile</DefineConstants>
  </Compile>
  <Compile Include="MyClass.boo" Condition='$(Configuration)' != 'Debug'/>
 </ItemGroup>

What I would like to do is this:

 <ItemGroup>
  <Compile Include="MyClass.boo">
   <DefineConstants Condition=" '$(Configuration)' == 'Debug'>OnForThisFile</DefineConstants>
  </Compile>
 </ItemGroup>

Scott




Answer this question

Feature Request: Condition Attribute on ItemMetaData Element

  • Dorian A

    Scott,

    Would you mind going to the MSDN Product Feedback Center and logging a bug about how this is missing from the documentation That way Brett, our documentation author, can get this fixed in the next MSDN refresh.

    Thanks!

    Neil

  • Andy Lambert

    I should have tested this first.  It turns out that MSBuild does support the syntax I want.  It is just not documented.

  • Radvis

    Requests like this should be posted in the MSDN Product Feedback Center.

  • Feature Request: Condition Attribute on ItemMetaData Element