Once I have an itemlist, is there an easy way for me to clear it At the beginning of my build, my itemlist has a set of files in a particular directory. As part of my build, I delete some of those files, and then want to reuse that ItemList to list only the files that actually exist. I haven't found a way to use the CreateItem/Output tasks to remove items from an itemlist. Is there a way to do this
<ItemGroup>
<Files=*.mightbedeleted/>
</ItemGroup>
Later on in the build, there are fewer *.mightbedeleted files. How do I redefine the Files ItemList to only include the ones that still exist
Many thanks,
Taylor Brown

Redefining an ItemList
JeremyB
Thanks for the quick response. This is exactly what I needed to know. You've helped me solve what I thought was going to be a difficult problem (as detailed in my lengthy post entitled: Batching a target without using the Inputs and Outputs parameters )
Cheers,
Taylor
Gathar
You would have to create a new item list that contains the recent list that you are interested in. It is not possible to remove items from a list once it is defined.
However, you may be able to do what you are trying to do without removing the items from the list. Have you considered something like this Say you have a task that processes the item list after something has been deleted.
<ProcessItem InputFile='@(Files)' Condition="Exists('%(Files.Filename)')" />
This will execute your ProcessItem task once for each unique file that exists on disk.
Other option is to do a createItem with that wildcard and create the item after your deletes have been done, and when you know that you are ready to process the subset of files.
Faisal Mohamood
MSBuild Team