Click here to Skip to main content
13,050,450 members (87,402 online)
Click here to Skip to main content
Add your own
alternative version

Tagged as


2 bookmarked
Posted 25 Jul 2010

Copying Shared Assembly from GAC

, 26 Jul 2010
Rate this:
Please Sign up or sign in to vote.
This article describes how to copy an assembly from Global Assembly Cache (GAC)


"Computer wherein the common language runtime CLR is installed has a machine-wide code cache called the Global Assembly Cache. This Global Assembly Cache stores .NET assemblies specifically designated to be shared by several applications on that computer".


I faced problem where I am using a DLL in my project but by mistake got deleted, there is no source code for it to build it again and then use it, but however the assembly installed in the GAC is available. For Ex: Consider that Scheduler.dll got deleted from your project by mistake .., but is available in the GAC. As we cannot copy the DLL from GAC, and also cannot drag and drop as we do while installing. Follow the below explanation to copy the DLL from the GAC.


The default location of the GAC is under the <%Windir% >\assembly folder. The following screen shots displays a MS DOS Command Window wherein various commands have been executed at the prompt to copy the DLL from GAC. Go to command prompt path: C:\WINDOWS\assembly

The DIR Command displays four separate directories which are briefly described here

Now Inside the GAC_MSIL progressively drilling through this hierarchy of folders reveals the organization of the GAC and how it implements Side-By-Side installation Below screen shot shows the Scheduler.dll

Within each folder for a shared assembly, there is a sub folder named using the version and public key token components of the assembly
e.g. shown in above screen) Within this sub folder resides the actual assembly that is installed into the GAC. DisplayName, Version, Culture and PublicKeyToken are the components that uniquely identify the assembly.

Inside folder you can see Scheduler.dll

Now you can execute the COPY command to copy the dll from GAC to local system drive.

I hope the content presented in this document is useful.

NOTE: Additionally, using MS DOS commands to alter or delete these internal folders or contents of files therein may lead to unpredictable behavior or other serious problems that may require you to reinstall the .NET Framework on the affected machine(s). Use such commands at your own risk.


This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


About the Author

Rajesh Sajjanar
Architect MNC
India India
Rajesh Sajjanar is Technical Lead working for Enterprise Dotnet applications in Bangalore, INDIA. He holds batchelor degree in Electronics and Communication Engineering from Visvesvaraya Technological University Belgaum INDIA

You may also be interested in...


Comments and Discussions

-- There are no messages in this forum --
Permalink | Advertise | Privacy | Terms of Use | Mobile
Web02 | 2.8.170713.1 | Last Updated 26 Jul 2010
Article Copyright 2010 by Rajesh Sajjanar
Everything else Copyright © CodeProject, 1999-2017
Layout: fixed | fluid