OracleConnection throws EEMessageException in managed C ++
I have my own C ++ application that needs to be connected to Oracle DB. Oracle Data Layers are written in C #, so I was hoping to reuse the code as a DLL.
I decided to try using managed C ++ to bridge the gap between native C ++ and C #. The C ++ adapter managed layer works fine (almost); An unmanaged C ++ executable can run various classes and methods in C # code without issue.
Error:
Except forSystem.Data.OracleClient.OracleConnection
that, of course, the really important part.
When I call Open()
on it rushes EEMessageException
. I am using Oracle 9 on Windows XP.
My C # dll object works fine when called from C # exe. So I think it has some kind of problem loading assembly or oracle driver problem into native process that hosts CLR in dll.
Here the C # dll works fine in a normal C # application.
..................
'OracleTest.vshost.exe' (Managed): Loaded 'C: \ WINDOWS \ assembly \ GAC_MSIL \ System.Configuration \ 2.0.0.0__b03f5f7f11d50a3a \ System .Configuration.dll ', missing boot characters. The module has been optimized and the debugger option "Only my code" is enabled.
'OracleTest.vshost.exe' (Managed): Loaded 'C: \ WINDOWS \ assembly \ GAC_32 \ System.Transactions \ 2.0.0.0__b77a5c561934e089 \ System.Transactions.dll', missing load symbols. The module is optimized and the debugger option "Only my code" is enabled.
'OracleTest.vshost.exe' (Managed): Loaded 'C: \ WINDOWS \ assembly \ GAC_32 \ System.EnterpriseServices \ 2.0.0.0__b03f5f7f11d50a3a \ System.EnterpriseServices.dll', missing boot characters.The module has been optimized and the debugger option "Only my code" is enabled.
..................
Here's where it explodes in a C ++ managed-level C ++ application:
'QFeedTest.exe': Loaded 'C: \ app \ Oracle \ bin \ oci.dll', no binary was created with debug information.
First Chance Exception at 0x7c812afb in MyUnmanagedCPP.exe: Microsoft C ++ Exception: EEMessageException at memory location 0x0012d014.
Question:
Is there any project I can do to load the Oracle driver correctly?
a source to share
You can use the Fusion log viewer (fuslogvw.exe) to log what happens when .Net tries to load an assembly. Another thing is to debug your application as managed code rather than native, you should be able to see the actual managed exception and see what happens. If for some reason this is not possible, you can use the windows debugging tools and load the SOS extension - this allows you to more easily debug .Net code in WinDBG (you can also use SOS from Visual Studio).
a source to share