DLL Hell and Assembly Versioning
DLL Hell and Assembly Versioning
Imagine you have two apps, App A and App B, that need the same library (DLL file).
Now, App A doesn’t work because it only knows how to use version 1! This mess is called DLL
Hell. It was common before .NET because Windows didn’t have a proper way to handle
different versions of the same library.
1. Side-by-Side Versions:
.NET allows multiple versions of the same library to exist on the same computer.
So, App A can use version 1, and App B can use version 2 without any conflict.
2. Strong Names:
Every library in .NET gets a unique "ID card" called a strong name. It includes:
o The name of the library.
o Its version number.
o A unique public key (like a fingerprint).
Example
In Short
DLL Hell: Apps fight over which version of a library to use, causing crashes.
Assembly Versioning: .NET allows apps to use the exact version of the library they
need, solving the problem.
1. Objects in .NET
An object is an instance of a class or a data type. It is created from a class and can have
properties, methods, and events.
In .NET, everything is treated as an object (including simple types like integers, strings, etc.),
though these may be instances of special system classes.
Namespaces in .NET
A namespace is like a label or a folder that helps organize your classes so you don't mix
them up.
For example, imagine having two different "Car" classes in two different folders: one for
"SportsCars" and another for "ElectricCars". The namespaces help you know which one
you're talking about.
Namespaces in .NET
Namespaces are like folders that organize your classes (and other code) to keep things neat and
avoid confusion.
They help group related things together and prevent name clashes (for example, two classes
with the same name).
Example:
Let’s say you have a Car class in a folder (namespace) called VehicleNamespace.
To use the Car class, you need to tell your program where to find it (i.e., in the
VehicleNamespace).
{
public static void Main()
// Now you can directly use the Car class from VehicleNamespace
Summary:
Object: A thing created from a blueprint (class) that can have properties and do actions.
Namespace: A folder that organizes code to avoid confusion and name conflicts.
Think of objects as real-world things and namespaces as ways to keep everything in the right
folder so nothing gets mixed up.