CHAPTER 14 BUILDING AND CONFIGURING CLASS LIBRARIES
Table 14-1. Various Options of gacutil.exe
Option
Meaning in Life
-i
Installs a strongly named assembly into the GAC
-u
Uninstalls an assembly from the GAC
-l
Displays the assemblies (or a specific assembly) in the GAC
To install a strongly named assembly using gacutil.exe, first open a Developer Command Prompt,
and then change to the directory containing CarLibrary.dll. For example (your path may differ):
cd C:\MyCode\CarLibrary\bin\Debug
Next, install the library using the -i command, like so:
gacutil –i CarLibrary.dll
After you have done so, you can verify that the library has been deployed by specifying the -l
command as follows (note that you omit the file extension when using the -l command):
gacutil –1 CarLibrary
If all is well, you should see the following output to the Console window (you will find a unique
PublicKeyToken value, as expected):
The Global Assembly Cache contains the following assemblies:
CarLibrary, Version=1.0.0.0, Culture=neutral, PublicKeyToken=33a2bc294331e8b9,
processorArchitecture=MSIL
Furthermore, if you were to navigate to C:\Windows\Microsoft.NET\assembly\GAC_MSIL, you would
find a new CarLibrary folder with the correct subdirectory structure (see Figure 14-20).
540