OCI mode support in NuGet-version

Discussion of open issues, suggestions and bugs regarding ADO.NET provider for Oracle
Post Reply
powelerl
Posts: 31
Joined: Thu 22 Dec 2016 10:00

OCI mode support in NuGet-version

Post by powelerl » Wed 04 Oct 2017 09:57

Hi,

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
  HResult=0x80131510
  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.
  Source=Devart.Data
  StackTrace:
   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

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: OCI mode support in NuGet-version

Post by 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/oracl ... ility.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.

powelerl
Posts: 31
Joined: Thu 22 Dec 2016 10:00

Re: OCI mode support in NuGet-version

Post by powelerl » Mon 09 Oct 2017 10:58

Yes, that is correct. Thanks for looking into it.

Shalex
Devart Team
Posts: 8088
Joined: Thu 14 Aug 2008 12:44

Re: OCI mode support in NuGet-version

Post by Shalex » Mon 30 Oct 2017 17:27

The bug with using Oracle Client by .NET Standard compliant assemblies in full .NET Framework project is fixed: viewtopic.php?f=1&t=36128.

Post Reply