Reputation: 602
I want error to be thrown if number of data-items more than one. Why doesn't the following work? How do I code correct expression?
<ItemGroup>
<Data Include="a"/>
<Data Include="b"/>
</ItemGroup>
<Error Text="Error!" Condition="@(Data->Count()) > 1" />
ps. msbuild v4.0
Upvotes: 17
Views: 5132
Reputation: 602
I've found solution: You want to wrap your expression with the single quotes
<Error Text="Error!" Condition="'@(Data->Count())' > 1" />
Upvotes: 37