web analytics

Global Assembly Cache

Options

codeling 1595 - 6639
@2017-09-14 14:47:44

The Global Assembly Cache (GAC) is a folder in Windows directory to store the .NET assemblies that are specifically designated to be shared by all applications executed on a system. Assemblies can be shared among multiple applications on the machine by registering them in global Assembly cache(GAC).

Starting with the .NET Framework 4, the default location for the global assembly cache is %windir%\Microsoft.NET\assembly. In earlier versions of the .NET Framework, the default location is %windir%\assembly.

@2017-09-14 14:49:08

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.

@2017-09-14 14:54:46

If you intend to share an assembly among several applications, you can install it into the global assembly cache. There are two ways to deploy an assembly into the global assembly cache:

  • Use an installer designed to work with the global assembly cache. This is the preferred option for installing assemblies into the global assembly cache.
  • Use a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided by the Windows Software Development Kit (SDK).

You should share assemblies by installing them into the global assembly cache only when necessary. As a general guideline, keep assembly dependencies private and locate assemblies in the application directory unless sharing an assembly is explicitly required. In addition, you do not have to install assemblies into the global assembly cache to make them accessible to COM interop or unmanaged code.

To use the Global Assembly Cache tool (Gacutil.exe)

At the command prompt, type the following command:

gacutil -i <assembly name>

In this command, assembly name is the name of the assembly to install in the global assembly cache (C:\Windows\assembly).

The following example installs an assembly with the file name hello.dll into the global assembly cache. + 

gacutil -i hello.dll  

After .net 4.0, you should use the gacutil tool from following path:

%ProgramFiles%\Microsoft SDKs\Windows\v7.0A\bin\NETFX 4.0 Tools\

@2017-10-03 14:01:30

You should be able to uninstall an assembly from using the Windows interface as follows providing you have administrator privileges.

  1. Navigate to the GAC, which is located at %systemdrive%\Windows\Assembly.

  2. Right-click each assembly file that is included in your application, click Uninstall, and then click Yes to confirm

If you are unable to uninstall the dlls via the above method you can access the GAC folder without the special view by opening a run command and entering the path below and hitting enter.

C:\Windows\assembly\GAC_MSIL

This will allow you to interact with all the files in the GAC as a normal folder.

Comments

You must Sign In to comment on this topic.


© 2024 Digcode.com