I am a .NET developer and have had a few questions for a while now.
- 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?
- 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".
- 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.
- 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.