I'm working on a SSIS 2012 package. Inside a foreachfile loop, there is a variable "User::Filename", a fairly standard variable for this construct. In a later step inside the loop, I move the file to an archive directory. Then, I want to rename it. I map the "Destination" property to the new name, which is of the format "" + "YYYYMMDDHHMMSS" + @[User::Filename].
When I hit "Evaluate Expression" at design time, of course it works except the Filename is null, so doesn't show. I also set "delay validation" to true.
When I run the package, it fails because it can't find either the source or the destination file (Source set the same way... + @[User::Filename].) In the error message, it shows exactly the same string I got when I hit "Evaluate Expression" at design time.
Why doesn't it show the Filename?
Put a script task in the loop container with this code.
Then look in the output window for the list printed.