将引用的程序集添加到版本控制或仅保留对 GAC 的引用
我们与同事讨论了项目参考和版本控制系统。我们分为 2 组:
将所有引用的程序集(默认 .NET Framework 除外)添加到解决方案中的引用文件夹中,从那里引用并将该文件夹签入版本控制系统。优点:每个人都可以检查代码并构建项目,无论他在哪个环境中工作。
参考所有主要产品(例如 SharePoint)的 GAC,并且仅在参与该项目的所有人员都为该工作设置了系统(例如安装了 SharePoint 进行 SharePoint 开发,因为 VS2010 不会打开这些解决方案)。优点:您确信您正在针对实际安装的程序集进行操作,而不是开发人员之一已安装并复制到引用文件夹的某些 beta/SP/.. 版本。
最好的做法是什么?或者还有更好的解决方案吗?
We had a discussion with the colleagues about project references and version control systems. We're divided in 2 groups:
Add all referenced assemblies (except for the default .NET Framework) to a references folder in your solution, reference from there and check this folder in into your version control system. Pros: everybody can check out the code and build the project, no matter on which environment he's working.
Reference to the GAC for all major products (e.g. SharePoint) and only add more exotic libraries in the references folder, after all people working on the project have their system set up for the job (like have SharePoint installed for SharePoint development, since VS2010 doesn't open these solutions without). Pros: you're sure that you're working against the real installed assemblies and not some beta/SP/.. version that one of the developers has installed and copied over to the references folder.
What's the best practice? Or are there even better solutions?
如果你对这篇内容有疑问,欢迎到本站社区发帖提问 参与讨论,获取更多帮助,或者扫码二维码加入 Web 技术交流群。
绑定邮箱获取回复消息
由于您还没有绑定你的真实邮箱,如果其他用户或者作者回复了您的评论,将不能在第一时间通知您!
发布评论
评论(1)
如果您引用 GAC 版本的程序集,那么您需要维护已安装插件的列表,以便新开发人员可以立即开始工作。如果您不维护此列表,那么当开发人员从源代码管理进行初始检查时,解决方案将无法构建。
此外,如果从 GAC 引用,由于同样的原因,CI 系统可能无法成功构建。我知道在源代码管理中存储二进制程序集并不是一个很好的解决方案,但至少这意味着所有开发人员都将使用相同版本的文件
if you reference against the GAC version of assemblies then you need to maintain a list of installed addons so a new developer can start work straight away. If you don't maintain this list then when a developer does an initial check out from source control the solution will not build.
Also if referencing from the GAC a CI system may not have a successful build due to the same reasons. I know its not a great solution to store binary assemblies in source control but at least it means all developers will be using the same versions of files