I just wonder - if I need to deploy an assembly into the GAC, what is the "official" way of doing it?
Currently we either manually drag/drop into the c:\windows\assembly folder or we use gacutil.exe. The first way is obviously not the good one (it's manual process after all), and gacutil is part of the SDK and not available per default on production servers.
Are there any Microsoft deployment Guidelines?
Installing application components into the the Global Assembly Cache (GAC) can be useful if you are installing components that will be used by multiple applications on the same machine, or if you need to run multiple versions of the same assembly on a single computer.
There are two ways to remove an assembly from the global assembly cache (GAC): By using the Global Assembly Cache tool (Gacutil.exe). You can use this option to uninstall assemblies that you've placed in the GAC during development and testing. By using Windows Installer.
The simplest way by far is using a Setup project. There, you can just add assemblies from your project output(s) into a special GAC folder, and the installer will add them to the GAC for you.
If you're not using an existing installer technology, the "official" way is through the IAssemblyCache::InstallAssembly native API. But a managed alternative can be found in the System.EnterpriseServices.Internal namespace. Despite the name, it is in fact a public class in a standard assembly.
Publish.GacInstall
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With