Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

re-evaluate an msbuild item group

Tags:

msbuild

I have an item group that includes a location which may or may not contain files. If there are no files present at the point the item group is declared, is it possible to re-evaluate the item group at a later time to pick up files that may have been generated in the new location, or will I have to declare an identical item group at this time and use that?

like image 701
Joe Cartano Avatar asked Dec 06 '25 16:12

Joe Cartano


1 Answers

Item groups declared statically (outside of a Target, as a child element of the ) will be evaluated when the file is loaded. Item groups declared dynamically (within a <Target>) will be evaluated at the moment the execution passes through the target. For cases where the files are created during the build, you really should use a dynamic Item group.

like image 95
Brian Kretzler Avatar answered Dec 09 '25 04:12

Brian Kretzler