Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to validate references between two assemblies?

AssemblyA.dll refers to AssemblyB.dll

AssemblyB was rebuilt with new code, but not AssemblyA. Therefore, we no longer know for sure if AssemblyA is compatible or not. Maybe it will crash at runtime because some method or property was removed.

Theoretically speaking, is it possible to validate whether AssemblyA is compatible or not with AssemblyB, without having to actually rebuild it ?

like image 849
Utilitaire CCV Avatar asked Feb 17 '26 01:02

Utilitaire CCV


1 Answers

The scenario you describe is called the DLL Hell. Wich is just the Windows Specific Subset of Dependency Hell. And prior to .NET (and outside of it) it is dang common. It comes from basically only identifying a DLL by it's name and path.

The .NET Developers knew of it and tried their damndest to avoid it. .NET will not just identify a referenced DLL by the name. It will use at least the Name, Version and Zertificate.

Two dll can have the same name. As long as their version is differnt, .NET will have no issue keeping them appart. .NET does not even has issues keeping them both in memory at the same time. You do not just build against the "System.DLL". You build agianst the "System.DLL. Version Y, Zerficate X".

like image 176
Christopher Avatar answered Feb 19 '26 13:02

Christopher