What are the differences when referring to variables in MSBuild. For example in the following there is a @ and $ and as well as a % used.
<Copy SourceFiles="@(Files)" DestinationFolder="$(TempBuildDir)\%(RecursiveDir)">
<Output TaskParameter="CopiedFiles" ItemName="DeployFiles" />
</Copy>
$ denotes access to a property (some kind of variable that contains a simple value)
@ is for item, which typically is a group of files with attached metadatas under a name
% denote an access to a metadata of an item. There are wellknown metadatas (like RecursiveDir, see the definition in msdn) automatically attached to an item, or you can attach your own metadata when you define your items
lets say you define @(files) like this:
if c:\source contains files 1.txt, b/2.dll , c/3.xml, and c:\source2 contains a/4.exe, @(Files) is formed like this
file c:\source\1.txt, with metadata
color = ‘Blue’ and RecursiveDir = ”
file c:\source\b\2.dll, with metadata
color = ‘Blue’ and RecursiveDir = ‘b’
file c:\source\c\3.xml, with metadata
color = ‘Blue’ and RecursiveDir = ‘c’
file c:\source2\a\4.exe, with
metadata color = ‘Red’ and
RecursiveDir = ‘a’
If you define TempBuildDir like this
You have some kind of variable that contains a simple value : c:\temp
Your examples reads like this : copy every files defined in item File in a directory that is formed by concatening value of variable TempBuildDir with the Recursive directory where you found the file.
You end up with :
c:\temp\1.txt
c:\temp\b\2.dll
c:\temps\c\3.xml
c:\temp\a\4.exe