web analytics
Global Assembly Cache Options
codeling
Posted: Thursday, September 14, 2017 2:47:44 PM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 892
Points: 3738

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.

Sponsor
Posted: Thursday, September 14, 2017 2:47:44 PM
codeling
Posted: Thursday, September 14, 2017 2:49:08 PM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 892
Points: 3738

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.

codeling
Posted: Thursday, September 14, 2017 2:54:46 PM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 892
Points: 3738

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\

codeling
Posted: Tuesday, October 3, 2017 2:01:30 PM

Rank:Advanced Member
Groups: Member
Joined: 12/11/2015
Posts: 892
Points: 3738

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.

Users browsing this topic
Guest

Forum Jump
You cannot post new topics in this forum.
You cannot reply to topics in this forum.
You cannot delete your posts in this forum.
You cannot edit your posts in this forum.
You cannot create polls in this forum.
You cannot vote in polls in this forum.


© 2017 Digcode.com. All rights reserved.