Troubleshooting
Problem
You are trying to create the .NET demo programs that ship with IBM Informix Client SDK and you encounter an unhandled exception.
Symptom
C:\Users\informix\Documents\Visual Studio
2010\Projects\dotnetdemo\samples\bin\x64\Debug>dotnetdemo.exe all
Unhandled Exception: System.TypeInitializationException: The type
initializer for 'IBM.Data.Informix.IfxConnection' threw an exception. ---> System.DllNotFoundException: Unable to load DLL 'iclit09b.dll'
The specified module could not be found. (Exception from HRESULT: 0x8007007E)
at IBM.Data.Common.UnsafeNativeMethods.Ifx32.SQLAllocHandle(Int16
HandleType, IntPtr InputHandle, IntPtr& OutputHandle)
at IBM.Data.Informix.IfxConnPoolManager..ctor()
at IBM.Data.Informix.IfxConnection..cctor()
--- End of inner exception stack trace ---
at IBM.Data.Informix.IfxConnection..ctor(String connectionString)
at DOTNETDEMO.IfxDemo..ctor() in C:\Users\informix\Documents\Visual
Studio 2010\Projects\dotnetdemo\samples\DemoUtils\IfxDemo.cs:line 67
at DOTNETDEMO.IfxDemo.GetInstance() in
C:\Users\informix\Documents\Visual Studio 2010\Projects\dotnetdemo\samples\DemoUtils\IfxDemo.cs:line 79
at IFXDOTNETDEMO.CLDemoApp.CreateDemo() in
C:\Users\informix\Documents\Visual Studio
2010\Projects\dotnetdemo\samples\DemoApp.cs:line 112
at IFXDOTNETDEMO.CLDemoApp.RunAllDemos() in
C:\Users\informix\Documents\Visual Studio
2010\Projects\dotnetdemo\samples\DemoApp.cs:line 103
at IFXDOTNETDEMO.CLDemoApp.Run(ArrayList DemoList) in
C:\Users\informix\Documents\Visual Studio
2010\Projects\dotnetdemo\samples\DemoApp.cs:line 93
at IFXDOTNETDEMO.CLDemoApp.Main(String[] args) in
C:\Users\informix\Documents\Visual Studio
2010\Projects\dotnetdemo\samples\DemoApp.cs:line 71
C:\Users\informix\Documents\Visual Studio
2010\Projects\dotnetdemo\samples\bin\x64\Debug>
Environment
Windows
Diagnosing The Problem
There are two reasons why the DOTNETDEMO may fail in relation to the PATH.
1. If it fails to load the "DemoUtils.dll" which resides in
Directory of C:\Program Files\IBM Informix Client
SDK\demo\dotnetdemo\samples\bin\Debug
28/09/2012 12:28 <DIR> .
28/09/2012 12:28 <DIR> ..
28/09/2012 12:28 36,864 DemoUtils.dll
28/09/2012 12:28 40,448 DemoUtils.pdb
28/09/2012 12:28 16,384 DOTNETDEMO.exe
28/09/2012 12:28 15,872 DOTNETDEMO.pdb
07/05/2012 14:40 356,352 IBM.Data.Informix.dll
5 File(s) 465,920 bytes
2 Dir(s) 27,504,136,192 bytes free
2. If it fails to load the Informix runtime libraries (like iclit09b.dll and others) which are in
Directory of C:\Program Files\IBM Informix Client SDK\bin
07/05/2012 14:40 10,240 esqlauth.dll
07/05/2012 14:40 583,680 ic++t02a.dll
07/05/2012 14:40 1,230,848 iclit09b.dll
07/05/2012 14:40 163,840 idmit09a.dll
07/05/2012 14:40 20,992 idsnt09a.dll
07/05/2012 14:40 964,096 IfmxConn.dll
07/05/2012 14:40 388,096 ifxoledbc.dll
07/05/2012 14:40 454,656 igl4n304.dll
07/05/2012 14:40 8,192 iglxn304.dll
07/05/2012 14:40 18,944 igo4n304.dll
07/05/2012 14:40 14,336 irclt09b.dll
07/05/2012 14:40 32,768 iregt07b.dll
07/05/2012 14:40 10,240 irfnt09a.dll
07/05/2012 14:40 11,776 irrgt09a.dll
07/05/2012 14:40 48,640 irset09a.dll
07/05/2012 14:49 58,368 isqlt07c.dll
07/05/2012 14:40 1,288,704 isqlt09a.dll
17 File(s) 5,308,416 bytes
0 Dir(s) 27,503,611,904 bytes free
Resolving The Problem
1. Ensure that $INFORMIXDIR\bin is in your PATH. For example:
PATH=c:\Program Files\IBM Informix Client SDK\bin:$PATH
2. Ensure you are running the DOTNETDEMO.EXE from the "object" directory, not the
binary one:
Directory of C:\Program Files\IBM Informix Client
SDK\demo\dotnetdemo\samples\obj\Debug
28/09/2012 12:28 <DIR> .
28/09/2012 12:28 <DIR> ..
28/09/2012 12:28 749 ConsoleDemo.csproj.FileListAbsolute.txt
28/09/2012 12:28 5,284 DesignTimeResolveAssemblyReferencesInput.cache 28/09/2012 12:28 16,384 DOTNETDEMO.exe
28/09/2012 12:28 15,872 DOTNETDEMO.pdb
28/09/2012 12:28 11,003 ResolveAssemblyReference.cache
28/09/2012 12:14 <DIR> TempPE
5 File(s) 49,292 bytes
3 Dir(s) 27,503,611,904 bytes free
There is no DemoUtils.dll in the obj directory, so the executable fails to load the dependency library.
You have to run the dotnetdemo.exe from the "bin\debug" directory or
add "C:\Program Files\IBM Informix Client SDK\demo\dotnetdemo\samples\obj\Debug" to the PATH so the runtime can find the dependency libraries.
Was this topic helpful?
Document Information
Modified date:
20 January 2022
UID
swg21613231