当,当,不安装到GAC? [英] When and when-not to install into the GAC?

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

问题描述

当你应该安装到GAC,当你不应该? (我是指,果然,在安装新的客户机上,他们已经购买了我们的产品(S)时)。

When should you install into the GAC and when should you not? (I am referring, really, to installing on a client's machine when they have purchased our product(s)).

  1. 我有一个组件,它只会被我的一个应用程序(GAC或无GAC)?使用

  1. I have an assembly that is only going to be used with my one application (GAC or no-GAC)?

我有一个大会,我所有的应用程序共享(GAC或无GAC)?

I have an assembly that all my applications share (GAC or no-GAC)?

我所有的应用程序的可以的使用不同版本的我总成(GAC或无GAC)?

All my applications may use different versions of my assembly (GAC or no-GAC)?

这些都是三个场景... ...但我肯定有更多。我不一定找一个答案,只有这三个问题。

These are three scenarios... but I am sure there are more. I'm not necessarily looking an answer to only these three questions.

类似的问题:<一href="http://stackoverflow.com/questions/23578/what-are-the-advantages-and-disadvantages-of-using-the-gac/23598">What优点和使用GAC的缺点是什么?

Similar question: What are the advantages and disadvantages of using the GAC?

推荐答案

一般MS指南

  1. 没有
  2. 没有
  3. 没有

GAC确实是微软共同.NET库的存储库。是的,他们让开发人员使用它,但作为一个经验法则,如果你不需要GAC,不使用它。让事情变得简单和地方,如果它不受到伤害。

GAC is really a repository for Microsoft common .NET libraries. Yes, they let developers use it too, but as a rule of thumb, if you don't need GAC, don't use it. keep things simple and local if it doesn't hurt.

  • 我会考虑GAC只为性能方面的原因,例如,如果你有一些巨大的集会,试图把它们放到GAC和的 NGEN 的他们。它应该显著提高性能。微软确实是在安装过程中的所有标准.NET框架组件(现在你知道为什么安装需要这么长时间)。 Paint.NET它以及(提高他们的应用程序的启动时间)。然而,大多数的人都不在巨大的框架或Photoshop的竞争对手工作,所以大部分的时间,从GAC具有组装性能提升微乎其微。不值得放弃简单的X复制部署。

  • I would consider GAC only for performance reasons, for example if you have some huge assemblies, try to place them into GAC and NGEN them. It should significantly increase performance. Microsoft does it for all standard .NET framework assemblies during installation (now you know why that installation takes so long). Paint.NET does it as well (to improve startup time of their app). However most of us don't work on huge frameworks or photoshop competitors, so most of the time, performance gains from having assembly in GAC are minimal. Not worth giving up simple x-copy deployment.

有些开发人员可以用活性炭,以确保用户有足够的权限不能删除或修改其组件。

Some developers might use GAC to make sure that users with insufficient privileges can't delete or modify their assemblies.

对于其他人可能是版本原因,但在这里,你真的应该重新考虑。我不打算再重复已经说过,你可以在这里阅读为什么

For others it might be for versioning reasons but here you should really reconsider. I'm not going to repeat what has been already said, you can read here why.

不要忘了,一旦要部署到GAC,您的安装将需要管理员权限,你可以pretty的多少忘了点击一次部署,等等...

And don't forget that once you want to deploy into GAC, your installer will need administrator privileges, you can pretty much forget click-once deployment, etc...

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

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