Problem solve Get help with specific problems with your technologies, process and projects.

Why GAC and adding a third-arty DLL to GAC

I am a .NET developer and have had a few questions for a while now.

  1. What is the necessity of GAC? It could be another folder on the System. Do all the applications have to add a reference if they want to use the Assembly?

  2. I have this third-party DLL (ready-made DLL) that I have to add into the GAC. Could you list the steps of how I go about doing this? The DLL is very much a .NET DLL which opens using "ILDASM".
Thanks and regards.
  1. The GAC, or Global Assembly Cache, exists simply to maintain a relationship between strongly named assemblies and a file system subdirectory (see Applied Microsoft .NET Framework Programming by Jeffrey Richter). If you want to use another assembly (use objects from or call methods in it), regardless of its residence in the GAC, you must reference that assembly from your assembly.

  2. There are only two ways to deploy an assembly: privately and globally. Again, see Jeffrey Richter's book (chapter 3 covers deployment). Unless the vendor of the third-party DLL provided code or instructions for placing the DLL in the GAC, you should not do so. In fact, unless the DLL is strongly named, you won't be able to. If it happens to be strongly named, you could use GACUtil to add it to the GAC, but I can't recommend this. In fact, on an end user's machine, GACUtil may not even be installed. You'll need to work with the vendor on finding the proper way to deploy the assembly.

Dig Deeper on Win Development Resources

Start the conversation

Send me notifications when other members comment.

Please create a username to comment.