Rules of referenced assemblies copying

后端 未结 4 1648
南笙
南笙 2021-02-19 02:32

Which rules does VS (msbuild?) follow during solution build? In which cases it will copy indirectly referenced asemblies to output folder and in which not?

4条回答
  •  日久生厌
    2021-02-19 03:17

    It should copy all the recursive references. For example:

    enter image description here

    --- EDIT---

    The rules (at least in VS2010) seem to be as follows:

    • An indirect reference is copied only if actually used.
    • A direct reference is copied no matter what - even if not actually used.

    So, if you want to ensure that the assembly required for reflection is deployed, reference it from the root project.

    Reflection concerns aside, it seems to be enough to just add the minimal set of references at each level of project hierarchy.

提交回复
热议问题