Hi
How to add and remove an assembly from GAC?
Loading
Know the answer? Post it — somebody with the same question will find it here.
Sign in to answer this question
It is the same account you read, post and publish with — and you will come straight back to this page.
Satyapriya NayakPosted Oct 20, 2011, 11:52 PM
Each computer that .NET is installed on has a Global Assembly Cache (GAC) located in the Assembly folder in the Windows directory (usually: C:\WinNT\Assembly). The GAC contains information about shared assemblies which are components that can be shared among several applications (Ex. a DLL).
Shared assemblies must have globally unique names derived from their strong names (public keys generated to distinguish assemblies from other assemblies that may have the same names) which is Microsoft's solution to DLL hell. The GAC, not the registry, is the store for this information. When an application loads the GAC is examined by the Common Language Runtime to determine if the version of a shared component exists that is compatible with the one referenced by the application.
The gacutil.exe that ships with .NET can be used to add or remove a shared assembly from the GAC.
To add a shared assembly, from the command line enter:
To remove a shared assembly, from the command line enter:
When viewing the GAC in Windows Explorer shfusion.dll is used to provide the user interface. You can locate and rename this DLL to view the GAC like any other folder.
Thanks
Javeed M ShaikhPosted Oct 20, 2011, 9:50 PM
Open Visual Studio Command Prompt and type the following:
1. To Add an assembly to GAC
GACUTIL /i
2. To Remove the assembly from GAC
GACUTIL /u
Please do not forget to mark "Accepted Answer".