how to make a Visual Studio project file to copy indirect references?

旧巷老猫 提交于 2019-12-10 02:56:18

问题


As the screenshot shows, ClassLibrary1 relies on ClassLibrary2 and ClassLibrary2 relies on ClassLibrary3. And "Copy Local" is set to be "True". But when I compile ClassLibrary1, ClassLibrary3 won't be copied to the bin folder.

So how can I config the Visual Studio project file to make it copy indirect references?


回答1:


I don't think that this is possible.

If you want the indirect references to be copied locally, you will have to add a direct reference to them to each project that you want them to be in.

If you try to build the project using MSBuild you will probably be informed that the indirect dependency is missing; Visual Studio usually ignores the missing indirect dependencies if you aren't directly using anything from them.




回答2:


This question has already been asked here.

@competent_tech is correct in that this is not possible with Visual Studio alone. However, Alex Yakunin solved his problem with a custom MSBuild target.



来源:https://stackoverflow.com/questions/8291273/how-to-make-a-visual-studio-project-file-to-copy-indirect-references

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