32 bit WindowsService not able to connect to Oracle
Posted: Fri 21 Oct 2011 13:31
Hi,
on a 64-bit machine, we have created a windowsService. And this windowsservice is created in 32-bit mode using C#(while compiling this windowsService project, we set PlatFormTarget=x86)
I am not able to connect to oracle database with this windowsService. It throws an exception:
"Unable to load C:\Oracle\product\11.2.0\client_1\bin\oci.dll. Please check that you use 32x version of Oracle client with 32x application. DEBUG BUILD: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
But through the windows service, when I use System.data.OracleClient dll to connect to Oracle database, its able to connect. So it seems some issue with Devart component with WindowsService. (WindowsService runs under account: LocalSystem, and might be Devart is failing somewhere)
I have installed Oracle 11 client of both 32/64 bit on this machine. When I execute similar code through console app (with PlatformTarget=x86 i.e. console app compiled for 32-bit mode), its able to create OracleConnection successfully.
Pease help me for this issue.
-atul
on a 64-bit machine, we have created a windowsService. And this windowsservice is created in 32-bit mode using C#(while compiling this windowsService project, we set PlatFormTarget=x86)
I am not able to connect to oracle database with this windowsService. It throws an exception:
"Unable to load C:\Oracle\product\11.2.0\client_1\bin\oci.dll. Please check that you use 32x version of Oracle client with 32x application. DEBUG BUILD: An attempt was made to load a program with an incorrect format. (Exception from HRESULT: 0x8007000B)"
But through the windows service, when I use System.data.OracleClient dll to connect to Oracle database, its able to connect. So it seems some issue with Devart component with WindowsService. (WindowsService runs under account: LocalSystem, and might be Devart is failing somewhere)
I have installed Oracle 11 client of both 32/64 bit on this machine. When I execute similar code through console app (with PlatformTarget=x86 i.e. console app compiled for 32-bit mode), its able to create OracleConnection successfully.
Pease help me for this issue.
-atul