I'm developing a custom MSBuild task by inheriting from the base Task class. My task calls the Copy task declared in Microsoft.Build.Tasks.dll
setting the DestinationFolder property in the process. My custom task has a property called DestinationFolder declared as
public ITaskItem DestinationFolder { get; set; }
When calling this task from a build/project file I might pass in a parameter such as
<MyTask DestinationFolder="C:\Development\Test\%(RecursiveDir)"
the problem I have is that when this task executes, the DestinationFolder property seems to have no knowledge of the %(RecursiveDir)
bit, instead just seems to be set to C:\Development\Test\Bin
.
This question seems to suggest that there is no work-around for this problem. Is this definitely the case? I was wondering if it's possible to declare the property as a simple string then create a TaskItem object on the fly and if the DestinationFolder string contains the special %(RecursiveDir)
instruction to then set up the TaskItem object accordingly.