0

I have an application built in Asp.net, we upgraded the oracle database to 19c "where we were working on oracle 11g", first give us the below error:

Could not install package 'Oracle.ManagedDataAccess 21.5.0'. You are trying to install this package into a project that targets '.NETFramework, Version=v4.5', but the package does not contain any assembly references or content files that are compatible with that framework. For more information, contact the package author.

After searching I found the Oracle.ManagedDataAccess 21.5.0 requires .NET Framework version 5.

Anyway, I upgrade the target framework for all projects from 4.5 to 4.7.2 and that issue didn't appear anymore.

After that, I tried to install Oracle.ManagedDataAccess 19.13.0 and it was installed successfully but when I try to login "need to connect to the database" it give me the error message:

Oracle Data Provider for .NET does not support Oracle 19.0.48.0.0

I tried to clean the solution and rebuild it, but it didn't fix the problem.

M.Youssef
  • 146
  • 9

2 Answers2

1

Typically .dll assemblies are loaded either from Global Assembly Cache (GAC) or from folder where your .exe is located. The files from GAC take precedence!

Check which Oracle.ManagedDataAccess you have installed, you can use the Global Assembly Cache Tool (gacutil.exe).

gacutil /l | findstr Oracle

Have a careful look at the Policy Files, they may redirect to a newer version.

If you need to load a specific version of Oracle.ManagedDataAccess see How to load specific version of assembly from GAC

You can check the file and version of loaded Oracle.ManagedDataAccess with

connection.GetType().Assembly.Location
connection.GetType().Assembly.FullName

You may also check Client / Server Interoperability Support Matrix for Different Oracle Versions to see which client version works with your database:

enter image description here

Wernfried Domscheit
  • 54,457
  • 9
  • 76
  • 110
  • thanks for your response. anyway, the "fullname" return the below: "Oracle.ManagedDataAccess, Version=4.121.2.0, Culture=neutral, PublicKeyToken=89b483f429c47342" – M.Youssef Mar 28 '22 at 10:13
  • I'm wondering because I'm working on pl/SQL developer where I connect correctly to the server "Oracle 19c" also I have on my PC "oracle 11g" and also connect correctly, but when I run the application it didn't connect correctly to the database where I update the framework and the Oracle.ManagedDataAccess. – M.Youssef Mar 28 '22 at 10:21
  • "SQL Developer" or "PL/SQL Developer"? "SQL Developer is Java/JDBC based and does not use any of these drivers. PL/SQL Developer may bypass Oracle.ManagedDataAccess and uses the core library `oci.dll` directly. – Wernfried Domscheit Mar 28 '22 at 11:02
  • So, your application uses the `Oracle.ManagedDataAccess` version 12.1 – Wernfried Domscheit Mar 28 '22 at 11:04
  • I'm using "PL/SQL Developer" 32bit on my PC. – M.Youssef Mar 28 '22 at 11:21
  • So I can't upgrade the "Oracle.ManagedDataAccess"? because the "PL/SQL Developer" used 32bit where my oracle on my PC is "Oracle 11g 32bit" – M.Youssef Mar 28 '22 at 11:22
  • 1
    Oracle.ManagedDataAccess works for both, 32-bit and 64-bit. – Wernfried Domscheit Mar 28 '22 at 11:35
0

Upgrading your target framework to .NET Framework 4.6.2 or later is the fix. No need to use an old version of the package.

enter image description here

https://www.nuget.org/packages/Oracle.ManagedDataAccess

David Browne - Microsoft
  • 80,331
  • 6
  • 39
  • 67
  • Thank you for your response, anyway I upgrade the framework to"4.6.1, 4.7.2" in order and then update the Oracle.ManagedDataAccess to "19.13.0, 21.5.0" in order, and that didn't fix my issue. – M.Youssef Mar 28 '22 at 10:12