I’m trying to copy several files in the $(TargetDir) to another folder (e.g. C:\BinCache), but for whatever reason I cannot get MSBuild to stop complaining.
<Target Name='AfterBuild'> <Copy SourceFiles='$(TargetDir)\*.*' DestinationFolder='C:\BinCache' /> </Target>
What am I doing wrong here?
EDIT: The solution is to use a CreateItem task. Presumably, Visual Studio 2008 removes this restriction. Thanks Scott!
<Target Name='AfterBuild'> <CreateItem Include='$(TargetDir)\*.*'> <Output TaskParameter='Include' ItemName='SourceFiles' /> </CreateItem> <Copy SourceFiles='@(SourceFiles)' DestinationFolder='C:\BinCache' /> </Target>
SourceFiles needs to be an Item list
you’ll need something like
Just noticed you’re on 2005, in that case you’ll need to use the CreateItem task