What is GAC?

The global assembly cache stores assemblies specifically designated to be shared by several applications on the computer.
You should share assemblies by installing them into the global assembly cache only when you need to. Assemblies deployed in the global assembly cache must have a strong name. When an assembly is added to the global assembly cache, integrity checks are performed on all files that make up the assembly. The cache performs these integrity checks to ensure that an assembly has not been tampered with, for example, when a file has changed but the manifest does not reflect the change.
Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the .NET Framework SDK or Use Windows Explorer to drag assemblies into the cache.
To install a strong-named assembly into the global assembly cache
At the command prompt, type the following command:
gacutil –I
In this command, assembly name is the name of the assembly to install in the global assembly cache.

Showing Answers 1 - 2 of 2 Answers

samiksc

  • Jan 16th, 2006
 

GAC stands for Global Assembly Cache. It is used for storing shared assemblies. It stores all versions of a particular assembly so that on updating an assembly the existing applications which use the earlier version do not break.

For storing an assembly into the GAC you need to sign the assembly with a strong name. For this purpose follow these steps:

  1. Use sn.exe command line utility to generate a key pair
  2. Add the key file name to the assembly as value for AssemblyKeyFileAttribute.
  3. Build the assembly.
  4. Use gacutil.exe -i <assemblypath> command on the command prompt to install it in the cache.

  Was this answer useful?  Yes

Manu Gupta

  • Mar 23rd, 2006
 

A computer installed with the common language runtime has a machine-wide code cache known as Global Assembly Cache. In the .NET Framework, the Global Assembly Cache acts as the central place for registering the assemblies. All the shared Asp.Net assemblies have a unique name and they are placed in GAC.

Ways to deploy an assembly in GAC

1.An installer that works with the Global Assembly Cache can be used.

2.Use a developer tool called the Global Assembly Cache tool which is available in the .NET Framework SDK. We can also drag assemblies into the Global Assembly Cache using the Windows Explorer.

GAC is generally located in "Assembly" directory in WinNT.

  Was this answer useful?  Yes

Give your answer:

If you think the above answer is not correct, Please select a reason and add your answer below.