Click here to Skip to main content
15,885,546 members
Articles / Programming Languages / Visual Basic
Article

Warning: .NET Hell and Version Control, unstable, irreproducable bugs.

Rate me:
Please Sign up or sign in to vote.
1.36/5 (50 votes)
27 Aug 20033 min read 124.5K   11   38
Version mismatches can cause unreproducable instability

Introduction

Revision: According to Suzanne Cook below, apparantly all the framework .Net assemblies (not just MSCorLib) are a special case in which version numbers are ignored.  But my experience below still stands, and certainly these problems will arrise with non-framework shared resources.


Do you have an unstable application with weird, unreproducable bugs (like I had)?  Maybe you are suffering from ".Net Hell"?

As you will know, .Net incorporates the version number into the name of assemblies.  So when you reference System.Windows.Forms you are actually referencing a specific version, say V1.0.5000.0 (for the new CLR 1.1), (or V1.0.3300.0 for CLR 1.0).  There can also be multiple versions loaded in the same CLR at the same time.

But What happens if you get the references mixed up, say by using a System.Windows.Forms 1.0.3300.0 when using a 1.1 CLR?  Weird, unreproducable bugs deep within the runtime.  Thats what. 

So suppose you have assembly A which references your assembly B which references .net assembly S 1.0.  You now go through and upate A to .Net  1.1.  But the reference from B is still to S 1.0.  So now you have fun and games.

A confusing issue is that when you upgrade to Visual Studio 1.1 it not only upgrades your .sln file.  It also silently upgrades all the references in your assemblies in that solution to refer to 1.1.  So the problem does not always occur.  And worse, if you just double click on a 1.0 .sln file, it opens Visual Studio 1.0, despite the file bindings, and so does not upgrade anything.

So, you need to be very, very careful about which versions each assembly in your application refernces, and you need to manually go through them an upgrade them.

Note that apparantly .Net will allow you to have both versions in the same application space, but that is not a good idea!  And there are no errors or warnings raised.  The lack of decent diagnostics is the key to a lot of Windows Hell in general.

So do we move from the sublime to the ridiculous?

Microsoft's .Net documentation talks a lot a bout "DLL Hell" which was a complete lack of control over version numbers.  "DotNet Hell" is that All version dependencies are hard coded.  Why cann't we have the obvious solution, namely that we normally refer to the Latest version, but have the Option to override? 

Sure there are lots of configuration files that can be used to override versions at the application, machine and vendor configuration level. But what a complicated mess to have to be aware of just to fix a bug in a public assembly.

Maybe we'll look back fondly to the days of the bloated registry and DLL Hell.

Suzzane Cook adds some clarrifications below and refers to her excellent weblog.  Apparantly "framework" dlls are treated as another special case (different from mscorlib).  I only know as much as the documentation that I can find -- ie not very much at all.

But the bottom line for me was that I have a fairly simple 100% managed but multi solution application.  No config files, only framework public dlls.  And it was very unstable untill I reworked the version numbers which caused all bugs to disappear (at least the ones that weren't my own!).

License

This article has no explicit license attached to it but may contain usage terms in the article text or the download files themselves. If in doubt please contact the author via the discussion board below.

A list of licenses authors might use can be found here


Written By
Web Developer
Australia Australia
Dr Anthony Berglas

Comments and Discussions

 
GeneralDelete this article Pin
Onlygo28-Aug-03 18:51
Onlygo28-Aug-03 18:51 
GeneralHe has a point Pin
thepipe19-Aug-03 21:47
thepipe19-Aug-03 21:47 
GeneralRe: He has a point Pin
Suzanne Cook20-Aug-03 13:24
Suzanne Cook20-Aug-03 13:24 
GeneralMisunderstanding Pin
G. Beraudo19-Aug-03 20:52
G. Beraudo19-Aug-03 20:52 
GeneralRe: Versioning aint so simple Pin
A Berglas20-Aug-03 7:42
A Berglas20-Aug-03 7:42 
GeneralRe: Versioning aint so simple Pin
scadaguy21-Aug-03 3:47
scadaguy21-Aug-03 3:47 
GeneralWhoa! Pin
Suzanne Cook19-Aug-03 9:10
Suzanne Cook19-Aug-03 9:10 
GeneralLack of documentation Pin
A Berglas19-Aug-03 9:45
A Berglas19-Aug-03 9:45 
GeneralRe: Lack of documentation Pin
Figuerres19-Aug-03 10:56
Figuerres19-Aug-03 10:56 
GeneralRe: Lack of documentation Pin
A Berglas19-Aug-03 11:04
A Berglas19-Aug-03 11:04 
GeneralRe: Lack of documentation Pin
Stephane Rodriguez.20-Aug-03 1:02
Stephane Rodriguez.20-Aug-03 1:02 
GeneralRe: Lack of documentation Pin
Suzanne Cook19-Aug-03 11:35
Suzanne Cook19-Aug-03 11:35 
GeneralRe: Lack of documentation, P/Invoke Pin
A Berglas19-Aug-03 11:49
A Berglas19-Aug-03 11:49 
GeneralRe: Lack of documentation, P/Invoke Pin
Suzanne Cook19-Aug-03 11:56
Suzanne Cook19-Aug-03 11:56 
GeneralRe: Lack of documentation, P/Invoke Pin
A Berglas19-Aug-03 16:19
A Berglas19-Aug-03 16:19 
GeneralRe: Lack of documentation, P/Invoke Pin
Stephane Rodriguez.20-Aug-03 0:17
Stephane Rodriguez.20-Aug-03 0:17 
GeneralRe: Tools, Bibilography, MyProblem Pin
A Berglas20-Aug-03 7:34
A Berglas20-Aug-03 7:34 
GeneralRe: Lack of documentation, P/Invoke Pin
Suzanne Cook20-Aug-03 13:10
Suzanne Cook20-Aug-03 13:10 
GeneralSuzan, please answer a simple question Pin
Anonymous19-Aug-03 23:53
Anonymous19-Aug-03 23:53 
GeneralRe: Suzanne, please answer a simple question Pin
Suzanne Cook20-Aug-03 10:27
Suzanne Cook20-Aug-03 10:27 
QuestionA good point ,but perhaps a little strongly made? Pin
thepipe18-Aug-03 22:02
thepipe18-Aug-03 22:02 
AnswerRe: A good point ,but perhaps a little strongly made? Pin
A Berglas19-Aug-03 8:46
A Berglas19-Aug-03 8:46 
GeneralRe: A good point ,but perhaps a little strongly made? Pin
thepipe19-Aug-03 11:45
thepipe19-Aug-03 11:45 
Generalbring along dlls Pin
Black Dog18-Aug-03 20:19
Black Dog18-Aug-03 20:19 
GeneralRe: bring along dlls Pin
Stephane Rodriguez.18-Aug-03 22:17
Stephane Rodriguez.18-Aug-03 22:17 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.