如何在大型代码库中组织外部库
只是想知道社区在一个大团队中工作并使用数十种不同的解决方案时如何组织 .net DLL 库?
我特别好奇人们是否选择某种“库”文件夹来包含所有项目使用的所有外部 DLL,以及人们是否对其 DLL 进行版本控制,或者在 DLL 发布新版本时只是覆盖 DLL,并希望下次重新编译时的 .NET 解决方案会选择此问题,
我也不清楚您是否可以简单地将不同版本的 DLL 放入文件夹中并让解决方案选择此问题,或者 .net 是否强制您使用特定版本(注意:我们不需要签署我们的任何程序集)
Just wondered how the community organises .net DLL libraries when working in a big team and with tens of different solutions?
I am particularly curious about whether people choose to have some sort of 'library' folder which contains all the external DLLs that all projects use and whether people version their DLLs or just overwrite the DLL when a new release of the DLL happens and hope that the .NET solution on next recompile picks this up
I am also not clear whether you can simply drop a different version of a DLL into a folder and have the solution pick this up or whether .net enforces you to use a specific version (Note: We dont need to sign any of our assemblies)
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(2)
我在我们的存储库中有一个专门的文件夹,用于存放所有项目都可以引用的第三方库和 DLL。
至于版本控制,我会根据具体情况进行处理。对于一些不经常更新的库或者我不打算在最新版本发布时更新到最新版本的库,我只是将 DLL 放在那里。
然而,对于经常更新的主要库,我通常采用以下模式:
大多数项目将简单地引用“Current”文件夹中的 dll。但是,如果出现问题,他们可以参考较旧的问题。这样做的好处是,如果您发现问题,可以很容易地切换参考以查看它是否存在于旧版本中。
注意:如果一个项目依赖于另一个项目,您需要在项目之间使用相同的版本,因此最好尽可能尝试使所有内容都使用最新版本。
I have a dedicated folder in our repository for 3rd party libraries and DLLs which all the projects can reference.
As for the versioning thing I do that on a case by case basis. For some libraries which aren't updated often or which I don't plan on ever needing to update to the latest version if it comes out, I just put the DLL there.
However, for major libraries which update often I usually do the following pattern:
Most projects will simply reference the dll in the "Current" folder. However, if there is a problem then they can reference an older one. The benefit here is that if you find a problem it is very easy to switch references to see if it existed in an older version.
NOTE: if a project depends on another project you need to use the same version between projects, so it's best to try and make everything use the latest if possible.
当前通常有一个 Libs 目录,该目录与解决方案的其余部分以及每个项目中对 DLL 的相对引用进行签入。只要新版本具有相同的名称,它就会被选取 - 只需确保解决方案中的所有项目都引用相同的路径即可。
但是展望未来,新兴的最佳实践将是使用 NuGet 来管理您的依赖项到第三方库。我们现在才开始部署它——对于像 Prism 这样的外部库来说已经很棒了,而且还允许您为自己的共享库创建中央存储库。
Currently would typically have a
Libs
directory which gets checked in with the rest of the solution, and relative references to the DLLs from each project. As long as a new version has the same name, it will be picked up - just make sure all projects in your solution reference the same path.Going forward however, the emerging best practice would be to use NuGet to manage your dependencies to third party libraries. We are just starting to deploy this now - already great for external libraries like Prism, but also allows you to create central repositories for your own shared libraries.