VS解决方案,项目VS动态链接库的最佳实践动态链接库、解决方案、项目、VS

2023-09-04 00:24:36 作者:神明也愛过

每当我有使用跨我一直库的项目刚刚加入到相同的解决方案不同的网站/应用程序,并从那里引用它的库。需要的解决方案中进行调试时,这是伟大的,但在其他情况下,它似乎在解决方案资源管理采取了没有意义的,更大的空间。

Whenever I have a library that use across different websites/ applications I've always just added the library's project into the same solution and reference it from there. This is great when needing to debug within the solution but in all other situations it seems pointless and more space taken up in the solution explorer.

另一种积极或消极的是,如果该库是由其他人在该公司更新,我再建,它使用同样的事情,他们可能已经打破了构建另一个应用程序。如果由于某种原因,不能固定与当前的应用程序,那么你可以回到你的源控制和回滚到旧版本,但是这似乎有点太OTT。

Also another positive or negative is that if that library is updated by someone else in the company and I then build another application which uses the same thing they could possibly have broken the build. If for whatever reason that cannot be fixed with the current application then you could go back into your source control and roll back to an older version, but this seems a bit too OTT.

我只是想知道其他人对这个问题的想法。那你通常做的,基准的DLL或你的项目添加到您的解决方案。

I was just wondering what other people's thoughts on this subject are. What do you normally do, reference the dll or do you add the project to your solution.

推荐答案

我们维持我们的生产的DLL一个众所周知的位置在网络驱动器和参考是通过DFS UNC路径(无驱动器盘符)。这样我们就可以有不同的版本中使用的库的同时和更新不破code /强制进行重新编译,直至新版本需要使用。一个标准的命名方案,可用于确保如果一个项目总是希望使用最新版本就可以了。

We keep our production Dlls in a well-known location on a network drive and reference is via the DFS UNC path (no drive letter). This way we can have different versions of the library in use at the same time and updates don't break code/force a recompilation until the newer version needs to be used. A standard naming scheme can be used to ensure that if a project always wants to use the latest version it can.