.NET Assembly in GAC


If you've enjoyed reading this post then please subscribe to my Full Text RSS Feed.

Anyone who develops using .NET framework will encounter GAC, Global Assembly Cache. GAC is a shared repository of assemblies (DLL) maintained by the .NET runtime and all shared assemblies must be strongly named.

The usual location for a GAC assembly depending on your operating system are:

C:\Windows\Assembly
C:\Winnt\Assembly

Why a shared repository of assemblies?

Simply to facilitate code reuse instead of duplicating code between applications.

How to install an assembly in GAC?
You can use a utility called gacutil.exe

Installing assembly using gacutil.exe utility:
gacutil -i MyAssembly.dll

Uninstalling assembly using gacutil.exe utility
gacutil -i MyAssembly.dll

You can copy assemblies from GAC to a different location, i.e. for deploying from a development server to a production server.

How to copy an assembly from GAC?

1. On command prompt, goto the C:\Windows\Assembly directory.

2. Goto GAC_MSIL directory

3. Goto to CrystalDecisions.CrystalReports.Engine directory. I am using CrystalDecisions.CrystalReports.Engine as an example. The assembly that you want to copy would be in a different directory.

4. Goto the version directory, e.g. 10.5….. Then copy *.dll to c:\ or your location of choice.

And that’s how you copy an assembly from GAC for deployment.

Sphere: Related Content

SPONSORED LINK: Would you like to be a sponsor? To find out more, get in touch with us.

Related Posts

About the Author

a tech junkie and a software developer. a apple fan and an avid photographer. a frequent traveller and loves art and graphic novels. My Google+