Gacutil.exe to Add an Assembly to GAC

Usually, We should avoid using GACUtil to install assemblies to the GAC for the following reasons:

Unless the /r option is used, there is no way to track installation references in the GAC.

GACUtil.exe is part of the .NET Framework SDK and hence is not guaranteed to be on all target machines. Additionally, it is not marked as redistributable and hence you need to check the licensing to make sure you can package it up with your application's installation image.

Installing using GACUtil.exe does not enable Auto-Repair if the assembly in the GAC is missing (Auto-Repair is possible only with Windows Installer).

Below are the steps to handle GAC

Step1: Create a new transform

Step2: Add the dll to transform

Step3: Change the “Application Type” to .NET Application in installation export.

Step4: Delete all the assemblies and its folders from Windows->assembly->GAC

Step5: Copy all the assembly dll under GAC to the folder “Global Assembly Cache”

Step6: Goto Installation expert->Files section, we can see Global Assembly Cache being created. Add GAC assemblies to this folder.

On adding each file double click on the assembly, Change the Assembly Type to .NET

Step 6.1: Add the assemblies

Step 6.2: Add the other parameters like Name, PublicKeyToken and Version and the same can be handled by MSIAssembly table as well.

Step7: Compile the transform.

For install -Verify the assembly dll registration from this location (C:\Windows\assembly)

For uninstall- Assembly dll should be unregistered from this location (C:\Windows\assembly)