MethodAccessException on load

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

MethodAccessException on load

Post by powelerl » Tue 28 Nov 2017 15:52

Code: Select all

System.MethodAccessException: Attempt by security transparent method 'Devart.Data.Oracle.OracleHome.a(System.String, Int32)' to access security critical method 'System.Reflection.TypeExtensions.GetConstructors(System.Type)' failed.

Assembly 'Devart.Data.Oracle, Version=9.5.399.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.Data.Oracle.OracleHome.a(String A_0, Int32 A_1)
   at Devart.Data.Oracle.OracleHome.b(String A_0, Int32 A_1)
   at Devart.Data.Oracle.OracleHome.b()
   at Devart.Data.Oracle.b6..ctor(Boolean A_0, Boolean A_1, OracleHome A_2)
   at Devart.Data.Oracle.b6.a(Boolean A_0, Boolean A_1, OracleHome A_2, Boolean A_3, Boolean A_4)
   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 Powel.ManagedMetalayer.NetbasIntegration.Extensions.UseNetbasIntegration(MetalayerCompositionBuilder builder, String connectionString, String applicationName, String username, INetbasIntegrationMetadataLoadLogger logger, Action`1 configureContext)
   at Powel.iAMMaintenance.Netbas.Netbas.<>c__DisplayClass4_0.<CreateMetalayer>b__0()
   at System.Threading.Tasks.Task`1.InnerInvoke()
   at System.Threading.Tasks.Task.Execute()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter`1.GetResult()
   at Powel.iAMMaintenance.Netbas.ObservationDashboardCommand.<ExecuteAsync>d__7.MoveNext()
--- End of stack trace from previous location where exception was thrown ---
   at System.Runtime.CompilerServices.TaskAwaiter.ThrowForNonSuccess(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.HandleNonSuccessAndDebuggerNotification(Task task)
   at System.Runtime.CompilerServices.TaskAwaiter.GetResult()
   at Powel.iAMMaintenance.Netbas.ObservationDashboardCommand.<Execute>d__6.MoveNext()

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

Re: MethodAccessException on load

Post by powelerl » Tue 28 Nov 2017 16:20

NuGet .NET Standard 1.3 on Windows / .NET Framework 4.6 / OCI mode / Oracle 12c Release 1 32bit

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: MethodAccessException on load

Post by Pinturiccio » Thu 30 Nov 2017 15:14

We have reproduced the issue. We will investigate it and post the results here.

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

Re: MethodAccessException on load

Post by powelerl » Fri 01 Dec 2017 14:08

I am in need for a working 32bit OCI mode - is it possible to get a private build when this is fixed?

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: MethodAccessException on load

Post by Pinturiccio » Mon 04 Dec 2017 16:18

Yes, we will send you an internal build with the fix when the issue is fixed.

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

Re: MethodAccessException on load

Post by powelerl » Wed 06 Dec 2017 20:14

Super

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: MethodAccessException on load

Post by Pinturiccio » Wed 10 Jan 2018 15:15

We have fixed the bug with MethodAccessException in .NET Standard 1.3 compatible assemblies when linking them to a project, targeting Full .NET Framework. We are planning to release a new build at the end of the next week. We will post here when the corresponding build of dotConnect for Oracle is available for download.

Pinturiccio
Devart Team
Posts: 2420
Joined: Wed 02 Nov 2011 09:44

Re: MethodAccessException on load

Post by Pinturiccio » Fri 12 Jan 2018 10:02

New build of dotConnect for Oracle 9.5.429 is available for download.
It can be downloaded from http://www.devart.com/dotconnect/oracle/download.html (trial version) or from Customer Portal (for users with valid subscription only). We have also updated our NuGet package: https://www.nuget.org/packages/Devart.Data.Oracle/.
For more information, please refer to viewtopic.php?t=36449.

dmackenz
Posts: 1
Joined: Fri 09 Feb 2018 14:51

Re: MethodAccessException on load

Post by dmackenz » Fri 09 Feb 2018 14:53

Hello,

I am using .NET 4.6.2 (OCI) and your latest NuGet Library and am getting the same error?

Attempt by security transparent method 'Devart.Data.Oracle.Linq.Provider.OracleDataProvider.CreateConnection()' to access security critical method 'Devart.Data.Oracle.OracleConnection..ctor()' failed.

Assembly 'Devart.Data.Oracle.Linq, Version=4.8.1398.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.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: MethodAccessException on load

Post by Shalex » Tue 13 Feb 2018 18:34

We have reproduced the issue with .NET Standard Devart.*.Linq.* assemblies in .NET Framework project. We will notify you when it is fixed.

Shalex
Site Admin
Posts: 9543
Joined: Thu 14 Aug 2008 12:44

Re: MethodAccessException on load

Post by Shalex » Thu 15 Feb 2018 17:04

The bug with throwing MethodAccessException by .NET Standard provider assemblies when referencing them to a project, targeting Full .NET Framework, is fixed: viewtopic.php?f=1&t=36602.

Post Reply