Background
A C#/.NET web application that accesses an Informix database.
The Client SDK is installed locally.
Project references the IBM.Data.Informix.dll in the IBM SDK directory
I'm using the older dll because the Informix database we have to access is ancient (Version 7.something)
It works perfectly on my machine (Windows 10) when running in debug mode through Visual Studio. Great, I'll deploy it to the Test server (Windows Server 2012 R2).
First attempt
Could not load file or assembly 'IBM.Data.Informix, Version=3.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies.
The system cannot find the file specified.
Second attempt
OK, I'd better research this. See below for references.
Third attempt
More research
Fourth attempt
The type initializer for 'IBM.Data.Informix.IfxConnection' threw an exception.
Unable to load DLL 'iclit09b.dll': The specified module could not be found. (Exception from HRESULT: 0x8007007E)
More research
Fifth attempt
More research
Sixth attempt
More research
Seventh attempt
More research
Found this ominous paragraph https://www.ibm.com/developerworks/data/library/techarticle/dm-0510durity/index.html
Important: The IBM Informix ADO.Net driver is not self-contained in the IBM.Data.Informix.dll file that gets installed in the /bin directory of your installation. Apparently, it uses some of the other client code installed by the SDK. This means that you must install the Informix Client SDK on any machines that will use the ADO.Net driver. You cannot just include the IBM.Data.Informix.dll in your distribution. This could be a serious limitation for some applications. You also need to go through the SDK setup (SetNet32) to define your Informix data sources.
Do we really need to install the SDK on production servers? And have to install DLLs in the GAC? If so, how can people deploy to servers over which they have no control?
As you can probably tell, I don't have much experience with Informix and .NET.
I literally have no idea what to do next.
Any suggestions will be most gratefully received.
References in no particular order
Update 2019-01-25
Following on from @Satyan's answer I uninstalled all previous versions of the SDK and cleared the GAC
Eighth attempt
Ninth attempt
Tenth attempt
Fortunately I still had a copy of the older IBM.Data.Informix.dll
More research
Found these articles
which suggest the resolution is
Set INFORMIXDIR and PATH as system environment variables and then bounce the Microsoft Internet Information Server or the whole machine and try to run your ASP application again.
Eleventh attempt
In my research I have found reference to 'Informix Connect' which is supposedly used to install client products and in the client_install.pdf in the SDK download it makes reference to installconnect.exe, but that exe does not exist in the SDK I downloaded. If it is a separate download to the SDK, then I can't find it.
Update 2019-02-08
Decided to have another crack at this
Twelfth attempt
SQL0035N The file "en_us\IBM.Data.Informix.xml" cannot be opened.
at IBM.Data.Utilities.IfxResource..ctor(CultureInfo cultureInfo, String dirName, String fileName, String szMsgPath, String xpath)
at IBM.Data.Utilities.IfxResources.GetResource(CultureInfo cultureInfo, String xpath)
at IBM.Data.Informix.IfxException.get_Message()
Aha! A new error, I'm getting somewhere.
Thirteenth attempt
I also tried copying just the en_us folder into the informix folder - nope!
More references
Update 2019-02-14
Fourteenth attempt OK. I decided to risk it and install the SDK on the server.
What I didn't expect was the installation restarting the server without asking me first.
Anyway, when it came back up we were back to the original error
Could not load file or assembly 'IBM.Data.Informix, Version=3.0.0.2, Culture=neutral, PublicKeyToken=7c307b91aa13d208' or one of its dependencies.
The system cannot find the file specified.
OK. That didn't work. It also somehow messed up the installation of TFS which could no longer be accessed via a browser.
OK, I'll uninstall the SDK. Nope. The uninstall feature crashed out with a Java stack overflow error. Fortunately the server is a virtual, so I got last night's backup restored. All OK again.
The latest .Net driver which is V4, has equally good backward compatibility, and it is expected to work good with Informix database server version7. I would encourage you to try the latest.
The problem you may be getting is due to a clash with the old driver binary still deployed in the GAC (Global Assembly Cache). If so, worth try cleanup the GAC, and it can be done by the following command. Open Visual Studio Command Window (that matched the .net framework version you are using, in this case we are using .net SDK v4) FYI: Deploying assembly to the GAC may required Admin privilege, then you may open the VS command window as administrator.
cd INFORMIXDIR\bin\netf40
gacutil /u IBM.Data.Informix
Once the old binary is being cleared from GAC, reinstall it to the GAC by the following command.
gacutil /i IBM.Data.Informix.dll
Just for the record here's how I managed to solve the problem
It works, but I would have preferred a self-contained application instead of having to maintain two solutions.
User contributions licensed under CC BY-SA 3.0