OCI mode support in NuGet-version

OCI mode support in NuGet-version

Postby powelerl » Wed 04 Oct 2017 09:57


Is OCI mode supported in the NuGet-version?

Code: Select all
new OracleConnection($"User Id=***;Password=***;Data Source=***;License Key=***").Open();

I get the following exception:

Code: Select all
System.MethodAccessException occurred
  Message=Attempt by security transparent method 'Devart.Common.Utils.get_IsWIntel()' to access security critical method 'System.Runtime.InteropServices.OSPlatform.get_Windows()' failed.

Assembly 'Devart.Data, Version=5.0.1750.0, Culture=neutral, PublicKeyToken=09af7300eec23701' is marked with the AllowPartiallyTrustedCallersAttribute, and uses the level 2 security transparency model.  Level 2 transparency causes all methods in AllowPartiallyTrustedCallers assemblies to become security transparent by default, which may be the cause of this exception.
   at Devart.Common.Utils.get_IsWIntel()
   at Devart.Data.Oracle.OracleInternalConnection..ctor(b0 connectionOptions, OracleInternalConnection proxyConnection)
   at Devart.Data.Oracle.bz.a(g A_0, Object A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionFactory.a(DbConnectionPool A_0, g A_1, DbConnectionBase A_2)
   at Devart.Common.DbConnectionPool.a(DbConnectionBase A_0)
   at Devart.Common.DbConnectionPool.GetObject(DbConnectionBase owningConnection)
   at Devart.Common.DbConnectionFactory.b(DbConnectionBase A_0)
   at Devart.Common.DbConnectionClosed.Open(DbConnectionBase outerConnection)
   at Devart.Common.DbConnectionBase.Open()
   at Devart.Data.Oracle.OracleConnection.Open()
   at TestConsoleApplication.Program.Main() in C:\Users\erl\SourceCode\ManagedMetalayer\TestConsoleApplication\Program.cs:line 74
Posts: 19
Joined: Thu 22 Dec 2016 10:00

Re: OCI mode support in NuGet-version

Postby Shalex » Thu 05 Oct 2017 16:06

Your project type is Console Application with Target Framework=.NET Framework 4.6 (not .NET Core), isn't it?

We have reproduced the issue and are investigating it. We will notify you about the result.

JIC: https://www.devart.com/dotconnect/oracle/docs/?NET-Standard-Compatibility.html
OCI connection mode support is limited. For .NET Core, dotConnect for Oracle supports the OCI connection mode only on Windows, on x86 and x64 Intel (AMD) architecture, and on .NET Core you cannot specify the Oracle home to use. dotConnect for Oracle uses the first home found. Thus, OracleHome and OracleHomeCollection classes along with OracleConnection.Home and OracleConnectionStringBuilder.Home properties are not used on .NET Core. You can use the Direct mode on .NET Core.
Devart Team
Posts: 7709
Joined: Thu 14 Aug 2008 12:44

Re: OCI mode support in NuGet-version

Postby powelerl » Mon 09 Oct 2017 10:58

Yes, that is correct. Thanks for looking into it.
Posts: 19
Joined: Thu 22 Dec 2016 10:00

Return to dotConnect for Oracle