Assembiles RRS feed

  • Question

  • What is the GAC (Global Assemblies catch)?real time implementation?
    Thursday, March 29, 2007 7:05 PM

All replies

  • the Global Assembly Cache is a machine-wide store used to hold assemblies that are intended to be shared by several applications on the machine. Each computer where the common language runtime (CLR) is installed has a global assembly cache. The global assembly cache stores the assemblies specifically designated to be shared by several applications on the computer. 

    The .NET Framework provides two tools for working with the cache. One is a Windows shell extension that allows you to work with the cache using a Graphical User Interface (GUI). The other is a command line tool, called the Global Assembly Cache tool (Gacutil.exe), that is typically used in build and test scripts.

    Saturday, March 31, 2007 12:39 PM
  • That's really a nice answer Harshil, but please remove links before posting reply. It might create bad impression of yours. Wink
    Sunday, April 1, 2007 4:58 PM
  • Thanks sanket.
    I dont matter about the links, and i dont think that it will create any bad impression. on the contrary it would create good impression cause, for those questions that I dont have any answers, i am working hard to find the answer on the net Smile and then providing them with the appropriate help required Smile People should take this in a positive way Smile and give appropriate credits Smile
    Sunday, April 1, 2007 5:54 PM
  • I think your idea is good. Smile
    Sunday, April 1, 2007 6:27 PM
  • thanks my friend.
    Monday, April 2, 2007 4:43 AM
  • Nice one Harshil, This shows a positive attitude for learning purpose...
    Monday, April 2, 2007 4:11 PM
  • ranganathan should mark your reply as answer. What you say ? You definitely deserve it for giving the answer.
    Monday, April 2, 2007 6:17 PM
  • Each computer wherein the common language runtime is installed has a machine-wide code cache called the Global Assembly Cache. This Global Assembly Cache stores .NET assemblies specifically designated to be shared by several applications on that computer.

    As a general rule, the Windows Registry is considered legacy within .NET and XCOPY deployment is highly encouraged, which in turn implies building assemblies that are private to a program’s main executable. Yet, there is a definite need for a central repository for .NET System assemblies as well as other user created Shared assemblies and it is this very need which is addressed by the GAC. Refer to .NET Framework Developer’s Guide: Global Assembly Cache for the formal product documentation on this topic.

    The Microsoft KB article Q315682 HOW TO: Install an Assembly into the Global Assembly Cache in Visual Studio .NET walks the uninitiated through the steps required to install a .NET assembly into the GAC. If it is not already obvious, a key point to note here is that once your application installs Assemblies in the GAC, it loses the benefits of XCOPY deployment as these assemblies (other than the .NET System Libraries) must be explicitly installed in the GAC.

    While covering the basics, it is important to understand the concept of Identity as it pertains to a .NET Assembly. An Assembly’s identity includes its simple textual name, a version number, an optional culture if the assembly contains localized resources, and an optional public key used to guarantee name uniqueness and to protect the name from unwanted reuse (name spoofing). An assembly with a simple Identity includes just the mandatory simple textual name and version number components. Since the GAC is the machine-wide repository for shared assemblies, it is very easy to run into the problem of name collisions if these assemblies only had simple identities because they are developed independently by different vendors and even developers within your own organization. Hence it is mandatory that every shared assembly installed in the GAC have a Strong Name. The formal definition of the term in the online documentation is

    A strong name consists of the assembly's identity — its simple text name, version number, and culture information (if provided) — plus a public key and a digital signature. It is generated from an assembly file (the file that contains the assembly manifest, which in turn contains the names and hashes of all the files that make up the assembly), using the corresponding private key.

    Tuesday, April 10, 2007 8:16 PM