DLL Hell Problem and Solution

DLL Hell Problem

DLL Hell is a problem in which two different Application share a common assembly and If one Application changes the common assembly, the changes which are not backward compatible will cause another Application to crash. Let us understand this with an example.

Let say you have two Applications, we can call it as Application1 and Application2  and both Applications shares a common Assembly we can call it as Shared. Both Application consumes GetOperation().

Dll hell problem

Both Application working well. But After a few time Application2 decides to change its Application. So during change  Application2 renamed GetOperation() function to GetOperationNew() in Shared assembly. So after this Application2 runs fine as it consumes GetOperationNew() which is in Shared Assembly but Application1 crashes.This situation is called as DLL hell problem. 

DLL Problem Solved

To solve DLL Hell problem you have to Strongly named the assembly.With strongly named assembly you can put different versions of same assemblies in a GAC. So if Application2 did any breaking change, the change will be in the different version of Shared Assembly so it will not affect Application1. 

You can also found this useful : How to sign third party assemblies?   

Leave a Comment

Your email address will not be published.