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
itemgroupmsbuild
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
Best Answer
No, as the documentation states, Remove can only be included in a ItemGroup inside a Target. I'm not sure why using a Target is an issue in your case, but if want to use the 'Remove' step for every build config, then add it to one of the BeforeXXXX AfterXXX hooks, like BeforeBuild.
ItemGroup 'Remove' Documentation