Monday, July 18, 2005

Adding an Assembly to the GAC

The Global Assembly Cache (GAC) stores assemblies that are meant to be shared by several applications that run on the computer. It is located in %WINDIR%\Assembly. Mine for example, is located in C:\WINDOWS\assembly.

There are several ways to install an assembly into the GAC:

-         Drag the assembly from your BIN folder into %WINDIR%\Assembly

-         Use the Windows Installer (this will be covered in a future article).

-         Use the Global Assembly Cache tool: gacutil.exe.

 

The following is an overview of the gacutil.exe tool and its commands:

The gacutil syntax should be in the following format:

gacutil [options] [assemblyName | assemblyPath | assemblyListFile]

Here are some examples:

Install an assembly to the GAC:

gacutil /i assemblyToInstall.dll

Remove an assembly from the GAC:

gacutil /r assemblyToRemove.dll

List all assemblies in the GAC:

gacutil /l

List all assemblies matching a specified name:

gacutil /l System.Web.dll

Notes:

To install the assembly it must be strongly named. I will explain this in a future article.

References:

http://msdn.microsoft.com/library/default.asp?url=/library/en-us/cptools/html/cpgrfglobalassemblycacheutilitygacutilexe.asp

http://support.microsoft.com/default.aspx?scid=kb;en-us;815808#kb1#kb1

Monday, July 18, 2005 9:14:29 PM (GMT Standard Time, UTC+00:00)  #    Comments [0]  | 
Comments are closed.

Theme design by Jelle Druyts

Pick a theme: