Do I ever really need to use the Global Assembly Cache (GAC)?

送分小仙女□ 提交于 2019-12-12 16:31:28

问题


I've been building .NET web applications for many years now, and I never use the GAC?

What am I missing? Or am I better off staying away from it?


回答1:


The GAC is only useful if you register libraries which you're going to reuse. It is in no way obligatory to use to run a WebApp without shared libraries .




回答2:


The GAC is mainly for storing shared libraries, especially when your application requires a specific version. This way, I could install FooLib 1.0 and FooLib 2.0 on the same machine, and applications that require either one could find the ones they want. Web applications don't seem to use a whole lot of external libraries anyways.

In another example, SSIS requires that your custom tools are in the GAC. Major pain.




回答3:


Like Vincent says, the GAC is important mostly for third-party library vendors who want to support servicing independent of client applications. In other words, if there's a bug in the library, you could upgrade the library and fix all applications that use the library, without having to know which applications they are, etc.

In practice, most .NET applications (so far) are web applications, so it turns out that it's mostly useful for Microsoft, as few other people have routine ability to push updates to end-user machines.



来源:https://stackoverflow.com/questions/313842/do-i-ever-really-need-to-use-the-global-assembly-cache-gac

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!