I have a dependency chain that looks like this (simplification for example purposes):
application -> foo (contains foo.dll) -> bar (contains bar.dll and bar_data.xml)
the dependent files are correctly marked with "copy if newer" on the data file and "copy local" on the references.
- bar/bin/Debug correctly contains bar.dll and bar_data.xml
- foo/bin/Debug correctly contains foo.dll, bar.dll and bar_data.xml
- application/bin/Debug only contains foo.dll and bar.dll (and app.exe), but not bar_data.xml
If I make application dependent on foo and bar, then I correctly get all three files.
I haven't found anything on either msdn or stackoverflow that covers this case.
MSBuild doesn't pick up references of the referenced project - doesn't work if you have a directed graph of dependencies rather than a tree (app links to foo and baz which both link to bar).
How to make MSBuild to automatically copy all indirect references to output (bin) folder and /LinkResource in Visual Studio 2010 - only work on ".pdb" and ".xml" files that have the exact same name as the project, though Alex's's example seems to be closer to what I need.
edit:
Marking the files to deploy (baz_data.xml) as "linkresource" works if you want the files in exactly the same location as the dll.
In my case I want them in a subdirectory due to the deploy environment.