Weird .NET errors

I’ve come across some weird .NET errors in one Windows 2000 Server with .NET 1.1:

System.NullReferenceException inside the function System.Enum.System.IConvertible.ToBoolean;

Also System.ArgumentException creeps up.

The main issue here is that sometimes the application works, and some times it doesn’t. Also other applications that share the same web server show the same symptoms.

Another weird issue is that when one of the applications work, the other doesn’t work and vice-versa.

To cut a long story short, this boils down to an issue to the ADODB.DLL. Each .NET application has a BIN directory where sometimes there is an ADODB.DLL. If these versions mismatch each other’s application versions, the issue related above happens. Simple, right :)?

How to solve it? Well make sure that the several instances of ADODB.DLL is the same version on each application, OR remove ADODB.DLL from the BIN directory from each application and put it on the Global Assembly Cache (GAC). How?

1) Create a directory, for example c:\adodb

2) Move the version of ADODB.DLL to this directory

3) Make sure that there are no more instances of ADODB.DLL on your .NET applications

4) Stop IIS (iisreset /stop) and delete all the temporary files created on the Temporary ASP.Net Files folder of your framework installation (c:\winnt\Microsoft.Net\framework\v1.1.1432\Temporary Asp.Net files\)

5) Register the ADODB.DLL on the gac: gacutil /i c:\adodb\adodb.dll

6) Restart IIS, with IISRESET

Problem solved (I hope…)

What happens is that the first application that was hit, moved is version of ADODB.DLL to the assembly cache (temporary), and the other applications, due to version mismatch failed to work because of this…

Lesson learned: Make sure that your BIN directory has the same versions of each file for each application.