重温GAC安装 [英] Revisiting GAC Installations

查看:164
本文介绍了重温GAC安装的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

这人去团团我知道,但我似乎无法找到一个满意的答复。

This one goes round and round I know but I can't seem to find a satisfactory response.

如果组件走在GAC?这些问题:<一href="http://stackoverflow.com/questions/498361/when-and-when-not-to-install-into-the-gac">when-and-when-not-to-install-into-the-gac和<一href="http://stackoverflow.com/questions/23578/what-are-the-advantages-and-disadvantages-of-using-the-gac/23598">What优点和使用GAC 的缺点,完全解决,但答案是非常建议......或你只应该...。为什么???

Should assemblies go in the GAC? These questions: when-and-when-not-to-install-into-the-gac and What are the advantages and disadvantages of using the GAC, address exactly that but the answers are very much "it is recommended that..." or "you should only ...". Why???

很多的GAC naysaying博客似乎日期从5/6年前净的明星已经开始它的崛起。难道我们还在那里吗?当然,DLL地狱是过去与GAC支持并排安装不同版本的相同的集会?

A lot of the GAC naysaying blogs seem to date from 5/6 years ago when .Net's star was beginning it's rise. Are we still there now? Surely DLL-Hell is a thing of the past with the GAC supporting side by side installation of different versions of the "same" assembly?

让我充实,我的顾虑。我们有一个不断壮大的网络应用程序(5至今)。这些都是在他们的核心,扩展到通过API调用和数据库扩展第三方应用程序。很明显,因此,所有这些应用程序共享了大量的code共同点,我们正在开发一套新的核心共享库,以提高我们的质量,维修等。

Let me flesh-out my concerns. We have a growing suite of web apps (5 so far). These are, at their core, extensions to a third-party application via API calls and database extensions. Obviously, therefore, all these apps share a great deal of code in common and we are developing a new set of core shared libraries to improve our quality, maintainability, etc.

当然,我想安装一次此共享功能和共享。所有关于打开一个维护的噩梦的论点似乎基于纪律涣散的一番天地。如果你打破ABI再碰撞的的AssemblyVersion足以让您现有的应用工作。

Surely I want this shared functionality installed once and shared. All the arguments about opening a maintenance nightmare seem based on some world of poor discipline. If you break the ABI then bumping the AssemblyVersion is sufficient to keep your existing apps working.

时的GAC一个真正的美人计的不知情?我是不是太天真?我是不是不必要的恶劣时,我辞退参数引用'的XCopy的损失安装为懒惰whinges?抑或是变得有点宗教和我应该去什么似乎是正确的?

Is the GAC truly a honey trap for the unsuspecting? Am I being naive? Am I being unnecessarily harsh when I dismiss arguments citing the loss of 'XCopy' install as being lazy whinges? Or is it getting a bit "Religious" and I should just go with what seems right?

感谢您帮助我看到了光明。

Thanks for helping me see the light.

推荐答案

我个人从来没有直接安装在GAC中的任何组件(除了作为一个纯粹的学术活动)。我听说前面的参数有关使用汇编从正在从几个应用程序访问一个集中的位置,虽然这似乎有点吸引人,就个人而言,这是不值得我的时间。计算机配备的硬盘空间320GB,这些天......我可怜的160K组件不会使一个凹痕,即使它被复制5次。 (当然,有些可能会说......你知道的共同问题:如果每个开发商是这样想的......,但我离题)。我选择不这样做的主要原因是因为一个特定的应用程序可能依赖于组装的一种方式,而另一个可能依赖于它的另一种方式。虽然在一个理想的世界中,更新该组件不应该影响依赖于它,在现实的应用中,经常做。如果我确定一个问题与程序集,因为一个特定的应用程序有问题吧,我在不知不觉中影响依赖于特定组件上的其他应用程序。在另一方面,有些人可能会争辩说,这种情况使我们更好的程序员,使我们的GAC-共享组件更防弹。这是伟大的,但我的工作作为一个程序员,主要不是让自己成为更好的程序员,但编写工作程序,而这样做,我会成为一个更好的程序员。

I personally have never installed any assemblies directly in the GAC (except as a purely academic exercise). I've heard the argument before about using an assembly from a centralized location that is accessed from several applications, and while that seems somewhat attractive, personally, it's not worth my time. Computers come with 320GB of hard disk space these days... my measly 160K assembly isn't going to make a dent in that, even if it's copied 5 times. (Of course, some could argue the "problem of the commons"... you know: "if every developer thought that way....", but I digress). The main reason I choose not to do this is because one particular application might rely on the assembly in one way, while another might rely on it another way. While in an ideal world, updates to this assembly should never affect the applications that rely on it, in reality, it often does. If I'm fixing a problem with an assembly because a particular application has issues with it, I'm unwittingly affecting the other applications that rely on that particular assembly. On the other hand, some might argue that this kind of situation makes us better programmers and makes our GAC-Shared assembly more bulletproof. That's great, but my job as a programmer isn't primarily to make myself a better programmer, but to write programs that work, and doing so, I will become a better programmer.

那么,什么是我的一票?远离GAC中。让每一个应用程序依赖于他们建立依靠集的版本。一个应用程序在装配曝光中的错误可能永远不会出现在其他应用程序,因为它们使用的组件不同,因此让他们成为你不会有回归测试的5个不同的应用程序的每一个共享的DLL被修补时间。

So what's my vote? Keep away from the GAC. Let each application rely on the version of the assembly they're built to rely on. A bug exposed in that assembly by one application may never show up in the other applications, because they're using the assembly differently, so leave them be and you won't have to regression test 5 distinct applications every time your shared DLL gets patched.

这篇关于重温GAC安装的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆