Tek-Tips is the largest IT community on the Internet today!

Members share and learn making Tek-Tips Forums the best source of peer-reviewed technical information on the Internet!

  • Congratulations strongm on being selected by the Tek-Tips community for having the most helpful posts in the forums last week. Way to Go!

When to use the GAC. 2

Status
Not open for further replies.

mmilan

Programmer
Jan 22, 2002
839
GB
Hi there...

I wonder if anyone has any references to any informative articles on the topic of when to use the Global Assembly Cache, or the GAC as it's known...

My employer has come across an page in the DotNet 2.0 documentation that claims that you shouldn't use the GAC unless you "explicitly" need to - and so is taking the attitude that since our application can be deployed without the GAC, we simply shouldn't use it.

However, we make use of a common third party suite of controls, and we face the question of where their stuff should be installed to - the GAC or our project folder. Personally, I think the GAC - let the strong naming of assemblies deal with versioning etc - afterall this is a popular suite of controls we're talking about - why have everything under our own project folder?

But, in the spirit of learning, I thought I'd throw the question out to the group. Personally, I'll be just as pleased to read arguments on either side of the fence - I know what I think right now, but I'm happy to be persuaded otherwise...

So, who's first?

Martin
 
The only thing you seem to get from using the GAC is a reduction in hard disk space when multiple applications use the same dlls. But why bother when 100Gb disks are so cheap.

On the flip side with the GAC you get a big headache when it comes to deployment. Using the GAC you can no longer deploy simply by copying the files and you can have an issue if another application that uses the dlls uninstalls itself taking the dlls with it.

As a result I tend to only use the GAC for very very common things which basically only includes the .Net Framework. Telerik, Infragistics etc get installed in my application dir.
 
Thanks for the response...

If the GAC is really that useless, then I'm amazed Microsoft made such a big deal of it. I thought it provided something of a safety net with different applications needing the different versions of the same supporting DLL, but I suppose this can be achieved quite easily with everyone keeping their own version in their project folder.

Odd...

Martin
 
It's important to Microsoft because they produce applications which have a lot of shared code, and have to run on PCs that have minimal spec.

It's also important to vendors like Infragistics who sell custom controls, and whose customers may have several applications running on the same machine that make use of their assemblies.

Using the GAC may not be important for the rest of us, however.

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Cheers Chiph...

Here's our situation - we have produced our own library of controls by essentially inheriting from a popular library of controls, and extending this original library (let's call it the original lib) and making it do a few things "our" way. So, we get a new library, which for the sake of neatness we'll call "New Lib".

When we come to deploy our product, we have to face the question of where the Original Lib should be installed to. This is a VERY well known library I'm referring to, and not it is not unlikely that other applications on the machine might be using it. However, our application is "the main application" which will be being used on the machine day to day.

It's a funny ol' world.

Martin

Ps. Hi by the way - I recognise your name from years ago on here...

 
I would not use the gac to much because the old dll hell will return. Meaning different versions of the same dll. I would keep my dlls in my applications folder and not disturb anyone else. The only reason why I would use the gac is if I had 10 or more apllications on the same computer that all use exactly the same dll and the same version of the dll.

PS: chiph is really old, nearly a fossile ;-).

Christiaan Baes
Belgium

My Blog
 
Hi Chrissie1!

I've been busy in recent months -- got involved with mountain biking, work, and a side-job. So haven't been around much.

I just checked -- I've been a member here for 8.5 years. That's a long time! I'll have to go hit up Dave for a coffee mug or something. ;-)


Also, Chrissie1 -- the GAC is versioned (unlike the system32 directory), so it's OK to have two or more versions of the same assembly in there. But what you want to watch out for is a gazillion versions stuffed into the GAC (aka: the 'version-of-the-week' club), as that will slow down it's lookups. Be a good computer citizen, and uninstall from the GAC when you no longer need an older version.

Even so, sometimes doing XCopy deployments make the most sense.
:)

Chip H.


____________________________________________________________________
If you want to get the best response to a question, please read FAQ222-2244 first
 
Status
Not open for further replies.

Part and Inventory Search

Sponsor

Back
Top