|
Answer» GAC stands for Global Assembly Cache. - Any computer where the CLR is installed has a global assembly cache.
- Global Assembly Cache stores ASSEMBLIES designated to be shared by multiple applications.
- It's a method to store DLLs in such a way that it can be ACCESSIBLE globally without worrying about any conflicts.
- Versioning is simple on the grounds that the GAC can hold numerous versions of the same DLLs without any issues.
- Bin folder of the application containing the local COPY of DLL isn't required, so a couple of megabytes can be saved on the HARD drive.
- Assembly can be installed in GAC by using a developer tool called the Global Assembly Cache tool (Gacutil.exe), provided in the Windows Software Development Kit (SDK).
Add, Remove and View Assemblies in the GAC - To install an assembly in the GAC, use the command as below:
gacutil /i “C:\someFolder\SomeAssembly.dll”Note: full path must be mentioned so that the tool gets the correct assembly. - To remove an assembly from the GAC, use the command as below:
gacutil /u SomeAssemblyNote: Only an assembly name is required. This command will remove all versions of the assembly. - To remove a specific version of an assembly, additional versioning INFORMATION is required:
gacutil / u SomeAssembly, Version = 1.1.1.1- To view the contents of the GAC:
gacutil / l
|