The other day I got an interesting question from a customer:
We are documenting how our production assemblies should be deployed on our production servers. At first we wanted to deploy shared assemblies through the gacutil.exe utility.
By reading this article we realized that Microsoft's recommendation is to use gacutil in a development environment but that it should not be used to deploy assemblies in production.
This raises the following questions: How should we deploy our assemblies in production? Why not gacutil? Any alternative to MSI?
The customer was referring to this note box:
The reason is explained in this article:
In deployment scenarios, use Windows Installer 2.0 to install assemblies into the global assembly cache. Use Windows Explorer or the Global Assembly Cache tool only in development scenarios, because they do not provide assembly reference counting and other features provided when using the Windows Installer.
The preferred installation method is a MSI package, but using the appropriate command line switches you can still use gacutil as described in http://msdn2.microsoft.com/en-us/library/ex0ss12c(vs.80).aspx:
Gacutil.exe provides options that support reference counting similar to the reference counting scheme supported by Windows Installer. You can use Gacutil.exe to install two applications that install the same assembly; the tool keeps track of the number of references to the assembly. As a result, the assembly will remain on the computer until both applications are uninstalled. If you are using Gacutil.exe for actual product installations, use the options that support reference counting. Use the /i and /r options together to install an assembly and add a reference to count it. Use the /u and /r options together to remove a reference count for an assembly. Be aware that using the /i and /u options alone does not support reference counting. These options are appropriate for use during product development but not for actual product installations.
Quote of the Day:
An adventure is only an inconvenience rightly considered. An inconvenience is only an adventure wrongly considered.