Installing an Assembly in GAC
page 1 of 6
Published: 24 Mar 2004
Unedited - Community Contributed
The Global Assembly Cache is used to share assemblies throughout applications on a web server. This article guides you in the process of adding an assembly to the GAC.
by Haroon Malik
Average Rating: This article has not yet been rated.
Views (Total / Last 10 Days): 48645/ 31


To share assemblies within an ASP.NET web application they are required to be placed within the \bin directory, but in order to share them through different applications existing on the same web server it is required to install them into the Global Assembly Cache (GAC). This article will provide guidance to you in the process of adding an assembly to the GAC.

View Entire Article

User Comments

Title: Nice Article   
Name: Bindya
Date: 2011-03-29 4:26:57 AM
Thanks,Helped me a lot
Title: Nice One   
Name: Jack Daniel Morilla
Date: 2011-01-12 9:31:10 PM
Thank helps for me a lot...
Title: Thanks   
Name: M.A.
Date: 2010-12-18 12:27:40 PM
Thank you so much for this article. Especially the thing with sn.exe was very helpful for me. MSDN not described very well.
Title: Installing an Assembly in GAC   
Name: Haroon Malik
Date: 2010-11-11 1:02:06 PM
This artical is very help full for me.Thank you very much.

Thanks and Regards,
Title: Installing Assembly in GAC   
Name: Anil Metugade
Date: 2010-07-31 3:59:26 AM
Ya nice article
Title: why do we need to istall an assembler   
Name: Salalenna Kuti
Date: 2010-07-21 7:26:53 AM
i was expecting a title under the umbrella title of installing assembly that will show the importance of installing an assembler under the .netframework.thank u
Title: GAC   
Name: Anusha
Date: 2010-04-30 9:12:50 AM
Simple and brief explaination..nice
Title: Good work   
Name: Rajeshree
Date: 2010-03-19 6:03:09 AM
I was looking for something very crisp, easy to understand,recallable stuff. Ur article is really good one.
Thanx for posting it...
Title: Nice Article   
Name: Bala
Date: 2010-03-11 5:15:15 AM
I was eagerly in search of such an article. Really nice article. It helped to generate strong name file, attach it to assembly and finally place assembly into GAC.
Thanks & Regards
Title: How do we add a DLL to the GAC without the source code   
Name: Jean-François Beauchamp
Date: 2010-01-05 9:08:36 PM

Is it possible to add a DLL to the GAC if I don't have the source code?


Title: comment   
Name: קייטרינג
Date: 2009-12-01 3:59:39 AM
keep on posing good articles!
Title: Senthil   
Name: Senthil Kumar
Date: 2009-11-16 9:13:07 PM
The explaination is really precise and explained in very simple way. Very well done.I didnot see best article like this
Title: Satheesh   
Name: Satheesh M Nair
Date: 2009-11-11 2:10:07 AM
This article is very good and nice
Title: Dinesh   
Name: Dinesh Samtani
Date: 2009-09-11 5:02:48 AM
This is a wonderfull article, but can you add a link to the topic of delay signing into this?
Title: Vinitha   
Name: Vinitha Varun
Date: 2009-07-21 2:23:37 AM
Thanks a lot..very nice article..
Title: sachin   
Name: sachendra singh chauhan
Date: 2009-07-18 4:41:36 AM
it's very easy process....
Title: nin   
Name: nino
Date: 2009-02-10 3:27:32 PM
how do you make a msi file to do the same thing. your articl is trivial
Title: Mr.   
Name: Edward Joell
Date: 2009-01-19 1:45:47 PM
sn -k resullts in "sn" is not recognized as an internal or external command operatable program or batch file.
Title: GAC article   
Name: a
Date: 2008-12-15 2:48:58 PM
Clear and informative! Here is some supplemental information regarding web.config in the framework 3.5:
Title: GAC   
Name: Saurabh
Date: 2008-10-25 6:46:33 AM
Really Good!!!
Title: GAC   
Name: Oli
Date: 2008-09-19 5:03:31 AM
The explaination is really precise and explained in very simple way. Very well done.
Title: GAC   
Name: lucky
Date: 2008-07-14 8:10:38 AM
Absolutely solid ! Very well explained keep it up!!
Title: GAC   
Name: Amol Gathale
Date: 2008-07-02 1:50:40 AM
Thanku Sir From Your article i am able to make the simple assembly to the globaly accessible assembly.I have the problem as i am creating one application . i want to instal on another machine.Please help me on
Title: Very Gud Article   
Name: Jayan
Date: 2008-06-20 3:36:58 AM
Hi this is wonderful
Title: Good Job   
Name: Naveen Kumar
Date: 2008-05-14 9:23:08 AM
Good articale...keep it up guys!!!!
Title: How to give reference to the other projects   
Name: Sajesh Kumar.K.P
Date: 2008-03-12 12:13:43 PM
Hi Malik,
Thanks for the detailed and simplyfied information.
But i am having a doubt, now i am able to register an assembly in the GaC. But i am not able to add that assembly reference to some projects.
Please tell me the steps.
I am using Visual studio 2.0 version.
Title: Mr.   
Name: MeanDude
Date: 2008-03-11 11:22:31 PM
Totally solid. I'm new at playing with .NET and the whole "how do I install an assembly into the GAC" thing has had me cussing for about thirty minutes. This was perfect and written in a way that I could understand. Thank you!
Title: Mr.   
Name: Kamrul Ahsan Chowdhury
Date: 2008-02-25 11:46:04 AM
I m so impressed with this article.
Title: Where should I put this code   
Name: Amit jain
Date: 2008-01-18 5:41:38 AM
When and where this code should i put.
Title: Simple but useful   
Name: Pavlo
Date: 2008-01-12 7:26:02 PM
Perfect article for newbies.

In fact - these tricks with GAC should know every .NET developer!
Title: Good job   
Name: Sterling "Chip" Camden
Date: 2007-12-27 3:23:48 PM
Thanks for the great tutorial. BTW, VS 2005 also has an option in the Project Properties to "sign" the assembly, which lets you generate the snk file and associate it with the assembly right there. All you have to do is rebuild and then add the assembly to the GAC using gacutil.

Keep up the great work!
Title: neelesh   
Name: neelehsgour
Date: 2007-10-17 1:47:35 AM
it is a very good article i have learnt very new thing to this article.Keep writing...
Title: Nice   
Name: BalaMurugan J
Date: 2007-07-20 2:49:24 AM
Very easy to understand and good
Title: Very Well   
Name: Adam Pan
Date: 2007-07-19 7:33:31 AM
Phase I: {sn -k sample.snk};
Phase II: Rebuild yours project(class library);
Phase III:Gacutil /u sample.dll
Phase IV: Gacutil /i sample.dll
Phase II must do before your using gac util tool.

Thank you!
Title: Excellent   
Name: Sumy Antony
Date: 2007-06-15 9:33:26 AM
Article was excellent !!!!
Title: That is excellent   
Name: Anthony Nadar
Date: 2007-06-14 8:12:24 AM
This artical is really simple to understand and digest. From long I wanted to know what exactly this bloddy GAC is. Now on reading your article it really became very simple for me to understand and keep in mind.

Thanks for the simple words used to understand the concept.

Keep it up.
Title: Hi   
Name: King
Date: 2007-05-22 8:39:59 PM
GAc installation is done but how could i acces the dll in projects
Title: Perfetto   
Name: Edo
Date: 2007-04-04 3:01:58 AM
Thanks, i learn what i want.
Title: Some missing things   
Name: Juanchi
Date: 2007-03-19 2:11:43 AM
I can't believe 99% of comments are like... congratulations?
It helps a lot, but there are a few things missing.
It would be great to explain where the sn.exe is taken from, plus it's not clear that "in the code of your assembly" means in AssemblyInfo file, plus where the .snk file should be stored? What about the debug and release directories, it must be in both?
It's a good article, but anyone that puts the hands at work find theese among other doubts. It could be great to complete this article a bit more.
Anyway, thank you!!
Title: Mr.   
Name: Ricardo
Date: 2007-02-17 10:30:24 AM
Finally found how to install the assembly in GAC
Title: GAC in   
Name: Jaydip
Date: 2007-02-17 12:41:03 AM
in case of application how is this possible to put an assembly in the server's GAC?Will the hosting provider allow us to do that?
Title: Mr   
Name: Alex Coll
Date: 2007-02-06 5:34:32 AM

for information on having an assembly installed in the GAC appear in the Add References dialog.
Title: Is it so simple!   
Name: Sanju, Delhi
Date: 2007-02-06 4:49:03 AM
I was doing a lot of research as I had to install some assemblies. I had tried out the gacutil way of registering earlier, but it was not successful. It didn't do it, with an error message as "Failed adding assembly to cache: unknown error".
When I searched on net, I could realize that probably it could have happened because of version differences in the gacutil and the current .NET version
Let me try out the explorer method now as u have explained. Drag and Drop!
Thank you
Title: good one   
Name: balaji
Date: 2007-02-06 12:34:13 AM
It is very good one.Any one can follow it very easily.
Title: very nice   
Name: praveen battula
Date: 2007-01-23 8:10:26 AM
hi, i don't know the author, but i want to appreciate him, really nice article, it helps me very much, thanks a lot,
nice , thanks to
Title: GAC   
Name: Abun
Date: 2007-01-16 12:03:37 AM
What a nice article!excellent!
Title: Mr.   
Name: Muneendra
Date: 2007-01-11 12:11:26 AM
Your explanation about GAC and Strongname is excellent.It is very easy understand and also clearly.
And also I am saying Thanks...
Title: Registering Strong Name Assembly   
Name: Jan Palmer Vergel
Date: 2006-12-04 8:44:35 PM
I ran the gacutil to register my dll:

gacutil /i SAPGOFConvertor.dll

but I encountered this message:

"Microsoft (R) .NET Global Assembly Cache Utility. Version 2.0.50727.42
Copyright (c) Microsoft Corporation. All rights reserved.

Failure adding assembly to the cache: The module was expected to contain an as
sembly manifest. "

I appreciate anyone who can shed a light to solve this.
Thank You.. or
Title: Mr   
Name: Manigandan
Date: 2006-11-27 5:14:02 AM
Your article gives me the clear idea of strong name and GAC and it's very useful for my project.

Thanks a Lot
Title: Mr   
Name: Percival Caburian
Date: 2006-10-31 3:35:50 AM
Every site seems to show how to install to GAC! -- (It's overrated now and a very boring topic)

How now do we reference the "SHARED" assembly in the GAC via the Add References of the VS 2005 IDE?

I can't see my GAC assemblies listed!

(It seems you can put in but not reuse from GAC.)
Title: Ms.   
Name: Patty
Date: 2006-10-24 2:20:03 PM
Excellent. Keep it up
Title: Mr.   
Name: Anand
Date: 2006-10-13 7:20:16 AM
Execllant article. GAC has been explained in a very simple way!!
Title: mr   
Name: jairam
Date: 2006-09-30 1:27:13 PM
superb explanation and very informative,i appreciate your efforts in doing this
Title: Excelent   
Name: Bruce One
Date: 2006-09-30 8:21:52 AM
Excelent article, precise and concise...
Title: GAC   
Name: Hemang
Date: 2006-09-25 5:25:37 AM
Very good article
Title: Appriciation   
Name: Shashank Shekhar Singh
Date: 2006-09-19 3:54:46 AM
Good one - keep it up!!!!!!!!
Title: Mr   
Name: venkat
Date: 2006-09-13 3:54:32 AM
this article very useful for how to install gac in our helps to everyone can to do this.
Title: Mr   
Name: Pratik Shah
Date: 2006-08-29 5:21:08 AM
Thanx for this article. Can u please tell me how to use multiple language in one application?
Title: Mr.   
Name: Sanjay Jaiswal
Date: 2006-08-09 5:59:42 AM
This is the Nice article to give the answer of my query... why to create the assembly and How to make it available for the whole .Net Application......simply Best!!!
Title: good introduction   
Name: mglil
Date: 2006-07-18 3:13:15 PM
your article is good introduction
Title: Mr   
Name: Naji Shaban
Date: 2006-07-01 9:06:10 PM
Can't make it easier to understand. Nice work. -:)
Title: Helpful   
Name: Shiv India
Date: 2006-06-24 9:45:24 AM
Nicely Explained the GAC
Title: Mr.   
Name: Vinit Srivastava
Date: 2006-06-09 7:01:39 AM
i understand GAC in very easy way. u describes in ur articl in very simple and easy language.
Title: Global Assembly Cache   
Name: Haroon Malik
Date: 2006-05-26 2:35:31 AM
gud document. easy to understand for beginners
Title: Mr.   
Name: Yogi
Date: 2006-03-31 11:08:41 AM

keep it ....
Thanks :)
Title: Ripped   
Name: Andy Miller
Date: 2006-03-16 3:03:29 PM
This article has some striking similarities to one in the Developer's Cookbook (sans a few personal comments...)
Title: miss   
Name: shanti
Date: 2006-03-03 3:34:00 AM
Title: GAC Code Description is Very Good   
Name: siva
Date: 2006-02-19 11:06:59 PM
Your GAC Code Descrition is very good and Simple

Title: GAC   
Name: Rajesh Medackel, India
Date: 2005-12-07 2:37:27 AM
An Excellent writeup on GAC.

Thanks a lot from the Web Community, Haroon Malik.

You deserve an applause
Title: Thank You!!   
Name: Jordi
Date: 2005-11-18 12:24:39 PM
This article is awesome! I'm using webmatrix doing and page with I had added everything to the GAC and added the reference in webmatrix but kept getting an error saying it couldn't find the namespace. After relentless searching i found your article, created a Bin folder in the directory with the files and dropped the Sybase.Data.AseClient.dll file in there and it worked!! Thank You!
Title: Mr   
Name: Shankar
Date: 2005-07-29 7:47:57 AM
Excellent! U had made a complex thing simple for those new to this area!! Great... and Thanks a lot...Do Continue ur services...
Title: -   
Name: Europa
Date: 2005-07-27 6:19:53 AM
Simple and efficient! Brilliant.
Title: Ms.   
Name: Mei
Date: 2005-05-31 9:37:43 PM
Excellent explaination about GAC, however, we may need to add some notice about the "third-party" components/controls issue here, e.g. need to put the third party assembly in the web.config file in order for aspx page to find the shared assembly..
Title: Ok Good   
Name: Firose Babu
Date: 2005-04-28 9:37:03 AM
Ok good
Title: great   
Name: santosh kapse
Date: 2005-04-07 9:05:37 AM

u explain the thing in very simple and easy way by taking care of all the requirement ...

thanks i got the concept of GAC
Title: nice   
Name: ravi
Date: 2005-03-28 3:17:41 AM
ver nice
Title: Mishra   
Name: Gyanesh
Date: 2005-03-08 6:54:43 AM
really VERY GOOD demo for installing GAC.
Title: mr   
Name: Gyanesh
Date: 2005-03-05 12:56:49 AM
very good
Title: Mr.   
Name: Shankar Prasad.C
Date: 2005-01-31 12:32:48 PM
Your article explained about the GAC and Strong name concepts in as simple yet effective way. Keep it up.

Product Spotlight
Product Spotlight 

Community Advice: ASP | SQL | XML | Regular Expressions | Windows

©Copyright 1998-2024  |  Page Processed at 2024-04-18 2:33:24 AM  AspAlliance Recent Articles RSS Feed
About ASPAlliance | Newsgroups | Advertise | Authors | Email Lists | Feedback | Link To Us | Privacy | Search