Please read What is dll hell? interview question, before proceeding with this article.
In short, the dll hell problem is solved in .NET by signing the shared assemblies with strong name. Please follow this article, to understand the process of strong naming an assembly.
In dot net all the shared assemblies are usually in the GAC. GAC stands for Global Assembly Cache. The path for GAC is C:\[OperatingSystemDirectory]\assembly. For example on my computer the path is C:\WINDOWS\assembly. The image below shows the shared assemblies in the GAC.
Only strong named assemblies can be copied into GAC. Strong named assemblies in .NET has 4 pieces in its name as listed below.
1. Simple Textual Name
2. Version Number
3. Culture
4. Public Key Token
All these four pieces put together, is called as the fully qualified name of the assembly. In the GAC image above Accessibility assembly has a version of 2.0.0.0.
Now consider the example below:
1. I have 2 applications, Application - A1 and Application - A2 which relies on the shared assembly Accessibility.dll (Version 2.0.0.0) as shown in the image below.
2. Now, I have a latest version of Application - A2 available on the internet.
3. I download the latest version of A2 and install it on my machine.
4. This new installation copies a newer version of Accessibility.dll into the GAC with version 3.0.0.0.
5. So, in the GAC we now have 2 versions of Accessibility.dll.
6. Application - A1 continues to use Accessibility.dll (version 2.0.0.0) and Application - A2 uses Accessibility.dll (version 3.0.0.0)
7. So, now the assemblies are able to reside side by side in the GAC. For this reason dot net assemblies are also said to be supporting side by side execution.
If you can improve this answer further, please feel free to do so by submitting the form below. Thank you very much for your contribution.
veknat,i ma very thankufull to you,you have picturesqued the dll hell problem..it s superb explnation.once agian thanku
ReplyDeletehi,
ReplyDeletethe explanations on this site are
very good simple and to the point Bravo!!
Really good one
ReplyDeletei dont know .net.. but i got it
ReplyDeleteIN DLL HELL PROBLEM WHERE IS THE SHARED ASSEMBLY STORED.I STUDIED THAT SHARED ASSEMBLIES ARE IN GAC.
ReplyDeleteshared assembly can be store in GAC if and only if it stronged name assaemly ....to know more about strong name there is full series post by Mr. Venkat
DeleteYou have made it so simple to understand.
ReplyDeleteThanks a lot.
hi i m gaurav
ReplyDeleteu can use very simple language to understand the question.
and it benifit for me i learn soo much from your site
Nice article for beginners and for the expertise as well
ReplyDeleteYou should have explained the problem first, then you can provide the solution. I don't find any clear explanation of the problem "DLL Hell". Allyou have provided is a solution of an Unexplained question.
ReplyDeleteFirst try to understand what the question is?.Don't read the article closing your eyes.Try to understand what you are reading in thiss article.He has given the basic idea in this article and it's really nice. He has given you a link before reading this article.DLL hell Problem has been resolved with the GAC.Don't discourage others.
Deleteplease first read this link
Deletehttp://venkataspinterview.blogspot.co.uk/2011/05/what-is-dll-hell-in-net.html
Bala Kiran did u contribute any blog before criticize.
DeleteHi Venkat,
ReplyDeleteDLL Hell solved in .net framework explanation with pictorial representation is nice which is easily understand by every one..
If latest version of A2 and installed it on my machine.How it will copy the new version of the assembly into the assebly filder witjout running the gacutil.Could u calrifty?
ReplyDeleteThanks, its Great.
ReplyDeleteIt is exactly Ilooking looking for.
Thank you again.
I have never seen a better explanation..
ReplyDeleteI spent many hours to get an idea on DLL problem in different websites but in vain. This site has given clear explanation. Thanks a lot
ReplyDeleteCreate a web application using asp.net and ajax technology that accepts a keyword and displays 10 relevant tweets from Twitter in real-time for that keyword.
ReplyDeleteYour way of explanation is very simple and best. Thanks a ton!!!
ReplyDeleteExcellent...
ReplyDeletegood simple way on explaining the dll hell. thank you
ReplyDeletethis site having quality content,the soltuions for this type of questions easily understood even if they dont know .net,superb.i am wasting so many dayes in front of net to know dll hell.but with this answer i am fully satisfied
ReplyDeleteexplanation is realy good
ReplyDeleteI know about assemblies and gac. But had no idea about the purpose of versioning. After reading this I got the point. Good example...
ReplyDeleteGood Presentation at all!!
ReplyDeleteGud Presentation!!!
ReplyDeleteI got an idea about dll hell problem. Thank u very much for the pictorial representation.
ReplyDeleteBut i have doubt after reading how the dll hell problem is solved?
Is it that the concept of GAC was not present when the dll hell problem had occurred? If yes then where were the shared assemblies stored prior to GAC?
ur reply will very much helpful to cler my concept.
I hope u will post ur answer.
Hi Sujith,
DeleteAs far as i know Prior to the concept of dll hell GAC was present but there is no version concept present.
Other than GAC we can store the Assemblies in bin folder of application
DeleteHi
ReplyDeleteThanks foe clearing my concepts.
Ashish Sharma
I got clear answer after long times.Very nice explanation.Thank u sir.
ReplyDeleteHats off to you Sir. After reading your posts, I have learned a lot.Keep It Up!
ReplyDeleteSuperb...work..easy to understand ...i had go through of may sites but...this one of best...thanx
ReplyDeleteNot only for this question, but every subject you touched, you are the master of them. I dont know how to thank you for your effort. no one does this better than you. God bless from the bottom of my heart sir.
ReplyDeleteI am 100% satisfied with your easily understandable explanation with simple examples for complicated topic that you have covered. Hats off you Sir....
ReplyDelete