ODP.NET on Mono?
628617Mar 14 2008 — edited Mar 20 2008Hi,
I have an application that runs on both .NET 2.0 and Mono 1.2.5.1.
We are building functionality to connect to an Oracle database, and we have tried using the Oracle.DataAccess.dlls that ship with OracleXE and with "Oracle 11g ODAC 11.1.0.6.21 with Xcopy Deployment".
Both work beautifully with our .NET 2.0 test application.
When we try to run our test application with Mono 1.2.5.1 on Windows, we get the following errors:
1.) from OracleXE dll:
Can not marshal 'parameter #1': Pointers can not reference marshaled structures. Use byref instead.
at (wrapper managed-to-native) Oracle.DataAccess.Client.OpsSql:AllocSqlValCtx (Oracle.DataAccess.Client.OpoSqlValCtx*&) at Oracle.DataAccess.Client.OracleCommand.Initialize () [0x00000]
2.) from ODAC dll:
Exception has been thrown by the target of an invocation.
at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.MonoCMethod.Invoke (BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000] at System.Reflection.ConstructorInfo.Invoke (System.Object[] parameters) [0x00000] at System.Activator.CreateInstance (System.Type type, Boolean nonPublic) [0x00000] at System.Activator.CreateInstance (System.Type type) [0x00000] at Test._Default.Run (System.String title, System.String connectionType, System.String adapterType, System.String connectionString, System.String query) [0x00000] at Test._Default.Run (System.String title, System.String prefix) [0x00000]
OracleDirect: An exception was thrown by the type initializer for Oracle.DataAccess.Client.OracleConnection
at <0x00000> at (wrapper managed-to-native) System.Reflection.MonoCMethod:InternalInvoke (object,object[]) at System.Reflection.MonoCMethod.Invoke (System.Object obj, BindingFlags invokeAttr, System.Reflection.Binder binder, System.Object[] parameters, System.Globalization.CultureInfo culture) [0x00000]
OracleDirect: The provider is not compatible with the version of Oracle client
at Oracle.DataAccess.Client.OracleInit.Initialize () [0x00000] at Oracle.DataAccess.Client.OracleConnection..cctor () [0x00000]
I've seen this message "The provider is not compatible with the version of Oracle client" mentioned in other posts on this forum, and I've tried the proposed solutions of updating the registry and adding the <runtime> tag into the config file...but neither has worked.
I will also note that this ultimately needs to run on Mono 1.2.5.1 on linux (Fedora Core 6). We have tried Mono's implementation in their mono-data-oracle RPM for 1.2.5.1 on fc6, and that hasn't worked either.
Lastly, we've explored the idea of using the Oracle JDBC driver and IKVM as a java/.NET wrapper, but we've seen other discussions online saying that this method doesn't work either.
Anyone have any ideas?
Has anyone had success running ODP.NET on Mono?
Thanks a ton for any help,
-Brian