Deploying Shared Components

The deployment of shared components is more complicated than the deployment in the previous examples. Though components can easily be shared by related applications, simply by putting them in a common component directory, shared components used by many applications on the system are often stored in the system assembly cache.

As with the previous examples, this revised Client.exe can be run directly on a file server from any workstation with the common language runtime installed, and Client.exe and Stringer.dll can also be copied to a local volume.

To install the shareable assembly into the system assembly cache, however, requires an additional step. The management of the system assembly cache is normally handled automatically as Microsoft Installer (MSI) packages are installed and uninstalled. However, it is also possible to manually install assemblies using the Global Assembly Cache Tool (Gacutil.exe) on the computer that will be running the corresponding Client.exe program:

gacutil.exe /i Reverser.dll

Note that this tool is not part of the .NET redistributable so, if the client computer does not have the .NET Framework SDK installed, this tool will first have to manually be copied to the client computer.

After installing the Reverser assembly, you can then examine the assembly cache by navigating to the \WindowsDirectory\Assembly directory, and using the assembly cache shell extension:

When it comes time to clean up the application, you need to do a little more work than in the previous examples. In addition to deleting the files, it is a good practice to remove the shared component file from the assembly cache (the assembly cache, unlike the download cache, is not automatically scavenged). The easiest way to do this is to use the cache shell extension, select the appropriate components, and delete them.

Developers and administrators who want to automate the process, however, will want to use the command-line interface to the assembly cache manager:

gacutil /u reverser

See Appendix B: Packaging And Deployment Tools for more information on this approach as well as information on using the Assembly Binding Log Viewer to verify the loading of assemblies.

See Also

(5) Component Versioning | Packaging and Deployment Summary | Appendix A: Additional Packaging and Deployment Information | Appendix B: Packaging and Deployment Tools