painiyff
painiyff

Reputation: 2719

Cannot import Oracle Client in ASP.NET Core RC2

With the new dotnet core, we can no longer import our referenced dlls externally, and instead have to get through a Nuget feed. I am trying to get Oracle.ManagedDataAccess Nuget package to work with my project, but no luck so far.

Here's the error in my project.json file:

enter image description here

Says The dependency Oracle.ManagedDataAccess >= 12.1.24160419 could not be resolved.

This is the error from Package Manager output:

Project Oracle.ManagedDataAccess is not compatible with netcoreapp1.0 (.NETCoreApp,Version=v1.0). Project Oracle.ManagedDataAccess supports: net451 (.NETFramework,Version=v4.5.1)

Does this mean I can no longer use this package? From what I've read so far, dotnet core does not support .net framework v4.5.1. If that is indeed the case, what are some alternatives I can use to connect to Oracle database?

Upvotes: 0

Views: 615

Answers (1)

Pawel
Pawel

Reputation: 31620

I just looked at Oracle.ManagedDataAccess NuGet package and I don't think it can run on CoreClr. First, it has a dll that targets only net40 so it is likely it uses some APIs not available in CoreClr/CoreFx or relies on things being in the box/GAC. Second, it has native binaries in bin\x64 and bin\x86 subfolders. I think even if you forced this package into a netcoreapp1.0 it may not work. If they use DllImport attribute to import these dlls CoreClr will not be able to find them because the structure of a package containing native assets is a bit different in the new world. In my opinion because of this dependency your application should just target full .NET (e.g. net451 or newer).

Upvotes: 1

Related Questions