msbuilditemgroup

Empty an MSBuild ItemGroup


Is there a way to remove the contents of an ItemGroup without resorting to Targets? I'm looking for something equivalent to:

<ItemGroup>
  <MyItemGroup Remove="@(MyItemGroup)"/>
</ItemGroup>

Thanks


Solution

  • Now there is.

    What's New in MSBuild 15

    • Item Element outside targets has a new Update attribute. Also, the restriction on the Remove attribute has been eliminated.