Ben
Ben

Reputation: 669

After updating IBM.Data.Informix.dll, project gives "Object reference not set" error

I developed a ASP.NET 2.0 replacement for an ASP.NET application at work initially using the original's version of IBM.Data.Informix.Dll (2.81). The replacement works fine for the most part, but intermittently hangs when connecting to the database (which is the problem with the original.) I decided to upgrade to the latest version of the dll (3.70), but upon deleting the old version and replacing it with the new, then adding a reference, I now get an "Object reference not set" error whenever I build the application.

The error does not specify a line or give any useful info. If I open one of the .aspx pages before building, I also get a warning on the file itself.

Here is the entire error:

: Build (web): Object reference not set to an instance of an object.

And the warning, for one page in particular:

Warning 2   \\io\wwwroot\intranet\cwsheet-test2\Selection.aspx: ASP.NET runtime error: Object reference not set to an instance of an object.    \\io\wwwroot\intranet\cwsheet-test2\Selection.aspx  1   1   cwsheet-test2

Additionally, when the aspx file is open, this is underlined at the top:

<%@ Page Language="C#" AutoEventWireup="true" CodeFile="Selection.aspx.cs" Inherits="XXX.Selection" %>

Again, this is only with the newer version of the dll. The dll is the correct version for my system (taken from the 64bit SDK). If I remove this dll and then replace it with the old one, it begins working fine again.

Just to address why I'm not using IBM.Data.Db2: The Informix server we have is 10.0, and DB2 only works with 11.10 and above.

In regards to Satyan's question: The GAC reference in the web site is set to 3.0.0.2; the version number of the DLL when I go to add the reference is 3.00.05000.2. If this could be the problem, how do I correct it?

Upvotes: 1

Views: 752

Answers (2)

Ben
Ben

Reputation: 669

Turns out the issue is oddly enough with the version of the driver. After getting fed up with trying to make the 64bit version work (this is on Server 2008 R2 64bit, so that's the proper version), I tried uninstalling that and using the 32bit version instead (which is what the 2.90 version was.) It worked perfectly. No idea why the 64bit caused an immediate problem even when added to a blank project. Though I'd rather have used that version than the 32bit, having spent a few days trying to find a solution I'm just going to go with the 32bit since it actually works.

Upvotes: 0

Satyan
Satyan

Reputation: 11

Most likely one of this could be the reason for this problem. The provider DLL on the GAC may not be right one. Or the machine.config may have wrong version information. Most likely it is located at (but depends on your setting) C:\WINDOWS\Microsoft.NET\Framework\v2.0.50727\CONFIG\machine.config.

A proper CSDK install should have updated both the entries. Are you trying to replace the provider DLL by a simple copy, if so it will not work. FYI: The “intermittently hangs” that you have mention is something different; not sure why.

Upvotes: 1

Related Questions