Skip to main content

You are not logged in. Your edit will be placed in a queue until it is peer reviewed.

We welcome edits that make the post easier to understand and more valuable for readers. Because community members review edits, please try to make the post substantially better than how you found it, for example, by fixing grammar or adding additional resources and hyperlinks.

4
  • I guess the question is how to configure the task so it actually copies files into target of ProjectB. Or more likely marks files in ProjectA folder somehow so ProjectB to copy files similar to references and other files with "copy to output Directory=always". Commented Jan 14, 2013 at 16:44
  • @Wolfwyrd, as Alexei said, your solution implies that I would have to modify ProjectB to perform the copy but I would like to avoid this. The "FileWrites" seems only to be used for tracking files when using "Clean" target but is not used for registering outputs. The Microsoft.Common.targets file seems to perform some specific operations to copy dependencies, and It is not clear that it is extendable to handle this. Commented Jan 15, 2013 at 1:05
  • @xoofx - so ProjectB contains your invocation of MyCustomTask at some point? Why can't you just put a <Copy> task invocation in the same target after MyCustomTask? Or why not just, in your code in MyCustomTask, do the copy via your favorite .NET copy API? Commented Jan 25, 2013 at 7:14
  • 1
    No Project B contains a regular ProjectReference dependency to Project A. But Project B doesn't know what Project A is actually doing (MyCustomTask or not). The solution requires a bit more hooking in msbuild, see my answer. Commented Jan 25, 2013 at 13:50