borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder

AndreaVB | Forum | News | Downloads | Register | Help | Member List | Statistics | Search | PM | Profile

Print This Topic
Previous Topic (how many built in object are there in asp and tell me their name and use briefly)Next Topic (What is serialization in .NET) New Topic New Poll Post Reply
AndreaVB Forum : ASP.Net : What is GAC ?
Poster Message
tri_inn
Level: Regular User
Registered: 26-08-2002
Posts: 395

icon What is GAC ?

please explain it.

07-08-2004 at 07:08 AM
View Profile Send Email to User Show All Posts | Quote Reply
fabulous
Level: VB Guru


Registered: 03-08-2002
Posts: 439
icon Re: What is GAC ?

GAC (Global Assembly Cache) is what .NET uses to store assemblies that need to be shared by more than one application.

In ActiveX (COM - Component Object Model), dlls and other ActiveX (COM) servers had to implement binary compatability with their previous versions in order for newer and old clients to work with them in harmony. If a developer broke the binary compatablity, the newer client programs could work but the older ones would not since all the GUIDs (Globally Unique IDentifiers) would have been re-generated. When you code, you access a class by using its human readable name of something like ADODB.Recordset for a recordset but the application stores the GUID so that it is guaranteed to be unique. When binary compatablity is broken, the GUIDs saved by the older clients will no longer work. It is for this reason that all ActiveX dlls had to be registered in the registry before they could be used. Windows would then allow an installer to update a dll only if the installer version was newer and it was safe to assume that older clients could work.

Failure to comply with this requirement led to what was called Dll hell. .NET however, did away with this binary compatability issue in exchange for a more simplified deployement model where all applications would keep their dlls in the application folder. Apps can exist with different, even incompatible versions of the same dll and there would be no conflict. There are times however, when a set of application have to share the same dll. It would not make sense for a user to install 10 of you appliations that each used a 3MB dll that you wrote and each keep a copy of this in their application folder.

The GAC therefore exists as place where your dll can install to. Your apps will then access the dll from there. This of course introduces problems because of the fact that .NET does not enforce binary compatabilty. To counter this fact, a requirement for assemblies to qualify for the GAC is that they have a strong name. This is proven by a key pair that the assembly is assigned which helps in determining that the assembly has not been changed. This is .NETs version of binary compatability. It is not as easy and intuitive to implement but it works. You can even have to versions of the same assembly sitting in the GAC and the client apps can still coexist in harmony.

I hope this helps.

____________________________
My boss is a Jewish Carpenter (Jesus Christ)


Brain Bench Certified VB.NET Developer

04-09-2004 at 06:15 PM
View Profile Send Email to User Show All Posts Visit Homepage | Quote Reply
AndreaVB Forum : ASP.Net : What is GAC ?
Previous Topic (how many built in object are there in asp and tell me their name and use briefly)Next Topic (What is serialization in .NET) New Topic New Poll Post Reply
Surf To:


Not Logged In? Username: Password: Lost your password?
Partners: Download Actual Software | Free Software Download
borderAndreaVB free resources for Visual Basic developersborder

borderAndreaVB Visual Basic and VB.NET source code resources - Copyright © 1999-2007 Andrea Tincaniborder