|
|
How Do I...Work with the global assembly cache?The global assembly cache is a machine-wide store used to hold assemblies that are intended to be shared by several applications on the machine. The .NET Framework provides two tools for working with the cache. One is a Windows shell extension that allows you to work with the cache using a Graphical User Interface (GUI). The other is a command line tool, called the Global Assembly tool (Gacutil.exe), that is typically used in build and test scripts. The command line tool is called the Global Assembly Cache tool (Gacutil.exe). All assemblies in the global cache must have strong names.
Viewing the Contents of the Assembly CacheNavigate to %winnt%\assembly using the Windows Explorer to activate the shell extension. The default view shows the contents of the assembly cache. You can also view the contents of the cache with the /l option of the Global Assembly Cache tool: gacutil /l Installing AssembliesTo install an assembly using the shell extension simply drag and drop the file containing the assembly's manifest into the global assembly cache directory. To install an assembly using the Global Assembly Cache tool, use the /i option: gacutil /i math.dll Uninstalling AssembliesTo delete an assembly with the shell extension, right click on it and select Delete. The /u option of the Global Assembly Cache tool can also be used: gacutil /u math,ver=1.0.0.0 The version of Windows Installer (1.5) that will ship in the Visual Studio .NET timeframe has native support for the assembly cache. When creating an Installer package with the Visual Studio Deployment tool or another setup tool, you can specify which assemblies you'd like installed in the cache. Using the Windows Installer to work with the assembly cache gives you the standard Installer benefits like install-on-demand, advertisement, publishing, and so on.
|