How to configure msbuild/MSVC to deploy dependent files of dependent assemblies

牧云@^-^@ 提交于 2019-12-23 20:49:42

问题


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.

来源:https://stackoverflow.com/questions/9742746/how-to-configure-msbuild-msvc-to-deploy-dependent-files-of-dependent-assemblies

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!