Best practice to share common libraries between solutions in .NET

后端 未结 3 2110
渐次进展
渐次进展 2021-02-16 00:09

We have pool of MSVS solutions (Solution \"A\", \"B\", \"C\", ... ) that share basic functionality in assembly called \"Common.dll\".

There are 3-5 active solutions (th

3条回答
  •  轻奢々
    轻奢々 (楼主)
    2021-02-16 00:26

    We practice something mostly like B.

    A CI server makes sure that the common libraries are always up-to-date (even if they use other common libraries themselfes). Each solution which uses common libraries has a "Lib" folder where we put the build artefacts, but these are not under source control (in contrast to external artefacts, such as the ones imported though NuGet).

    So while developing you don't get problems because of breaking changes in the common libs and the developer chooses the point in time when he upgrades (but he always has to do that before he commits to the central repo).

    The CI server will always copy the latest common libraries into the "Lib" of the solution under build, so that the latest common libraries are integrated. If we need to create a build with old libraries (specific hotfix release - very rare), we can always use the build artefacts with the matching date. Normal patch/fix releases are usually also upgraded to the latest common libraries though.

提交回复
热议问题