Remove Items From ItemGroups In MSBuild
Software Development, Team System March 25th, 2008
The ability to remove entries from ItemGroups is one of the new features of MSBuild 3.5.
To remove an Item from an ItemGroup in MSBuild 2.0 you would have to create a new ItemGroup from the old one and skip the Item that you needed removed.
In MSBuild 3.5 we can achieve it by using the Remove parameter.
Example:
<ItemGroup> <Files Include="a.cs" /> <Files Include="b.cs" /> <Files Include="c.cs" /> <Files Include="d.cs" /> <Files Include="e.cs" /> <Files Include="f.cs" /> <Files Include="g.cs" /></ItemGroup>
Some times we want to restrict some data from this group in a target. In order to do it, we should use the Remove parameter:
<ItemGroup> <Files Remove="a.cs" /> <Files Remove="e.cs" /> <Files Remove="f.cs" /></ItemGroup>
Read more at msdn.
Similar Posts:
- MSBuild basics
- <TestContainer> Works With WebTest & LoadTest In Team Build 2008 With SP1
- Restrict Users To Open WorkItem
- How To: Build Non-MSBuild Projects with MSBuild
- Copy WildCards With MSBuild
Tags: MSBuild, Team Build, Team Build 2008
About


This comment originally written by:
The ability to remove entries from ItemGroups is one of the new features of MSBuild 3.5. To remove an Item from an ItemGroup in MSBuild 2.0 you would have to create a new ItemGroup from the old one and skip the Item that you needed removed. In MSBuild