- 3,716,133 Users
- 2,242,960 Discussions
- 7,845,840 Comments
Forum Stats
Discussions
Categories
- 17 Data
- 362.2K Big Data Appliance
- 7 Data Science
- 1.6K Databases
- 479 General Database Discussions
- 3.7K Java and JavaScript in the Database
- 22 Multilingual Engine
- 487 MySQL Community Space
- 5 NoSQL Database
- 7.6K Oracle Database Express Edition (XE)
- 2.8K ORDS, SODA & JSON in the Database
- 417 SQLcl
- 42 SQL Developer Data Modeler
- 184.9K SQL & PL/SQL
- 21K SQL Developer
- 1.9K Development
- 3 Developer Projects
- 32 Programming Languages
- 135.1K Development Tools
- 9 DevOps
- 3K QA/Testing
- 259 Java
- 6 Java Learning Subscription
- 11 Database Connectivity
- 67 Java Community Process
- 1 Java 25
- 9 Java APIs
- 141.1K Java Development Tools
- 6 Java EE (Java Enterprise Edition)
- 153K Java Essentials
- 135 Java 8 Questions
- 86.2K Java Programming
- 270 Java Lambda MOOC
- 65.1K New To Java
- 1.7K Training / Learning / Certification
- 13.8K Java HotSpot Virtual Machine
- 10 Java SE
- 13.8K Java Security
- 3 Java User Groups
- 22 JavaScript - Nashorn
- 18 Programs
- 125 LiveLabs
- 31 Workshops
- 9 Software
- 3 Berkeley DB Family
- 3.5K JHeadstart
- 5.7K Other Languages
- 2.3K Chinese
- 4 Deutsche Oracle Community
- 11 Español
- 1.9K Japanese
- 2 Portuguese
ODP.NET Core beta 1does not work in .NET Core WebApi project

Hi All,
I struggle making the latest ODP.NET Core beta 1 release working in a .NET Core 2, WebApi new project. It all works well following the example on YouTube in a Console app but if I include a ref to the dll in a new .NET Core2 WebApi project I get the following error:
- System.IO.FileNotFoundException: 'Could not load file or assembly 'Oracle.ManagedDataAccess, Version=2.0.12.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. The system cannot find the file specified
Also, the same issue occurs when I include the library in a .NET Standard 2 project – (this is really where I need it!!)
Any suggestions?
NOTE:
After creating many test projects it "all of a sudden worked" using a .NET Core 2 WebApi startup project which has a reference to a .NET Standard 2 project in which I reference the ODP.Net beta 1 dll. "Fantastic !!" I thought and then added a NuGet package (signalR) that I need and BANG!, the same error occurred again.
I removed the NuGet signalR but still the above error comes up - even when I recreate the Core 2 WebApi and a brand new Standard 2 project ... it simply doesn't work anymore - totally - full stop (only as a Console app).
Best Answer
-
You probably hit this .NET Core bug.
It's a known .NET Core issue. One way to workaround the issue, which is use NuGet as you've seen.
Answers
-
I haven't been able to reproduce your issue on my own. Can you try two things for me?
1. Package ODP.NET Core as part of the same VS solution as your ASP.NET Core project, not as a separate library. This SO thread explains more.
2. Clean your solution, rebuild, and rerun.
If those steps don't fix your problem, then can you attach your test case to this thread? Reproducing the error seems very specific to some detail in your project.
-
Hello,
I Ported my ASP.NET MVC 5 project to .NEt Core 2.0 which is using ODP.NET dll. I downloaded and referenced nut i am getting "FileNotFoundException: Could not load file or assembly 'Oracle.ManagedDataAccess, Version=2.0.12.0, Culture=neutral, PublicKeyToken=89b483f429c47342'. The system cannot find the file specified."
I manually referenced the ODP.NET 2.0 dll but still i am getting error. i tried cleaning ,rebuilding the project i still get the same error.
Appreciate your quick response.
Thanks,
Sri
-
Never mind. i created small console app to test this. ODP.NET dll is working fine. I will see what is going on in my .net core app.
Thanks,
Sri
-
Hi,
there is not a solution yet, currently the Oracle component has a bug, I use it with a Web API project, which has several layers, but apart from referencing it in the Data project, for this component to work I have to reference it too in the api web project, it is not the best solution but it has worked for me now.
I hope this helps.
regards
Victor
-
The NuGet ODP.NET Core Beta 2 was released this week. I'm curious whether anyone experiences the FileNotFound Exception using the new beta.
-
Hello!
I'm using ODP.NET Core Beta 2 with a web api project and I've the same problem.
I've tryed on "Ubuntu/VS Code" and "Windows/VS 2017" with exactly the same result:
"Could not load file or assembly 'Oracle.ManagedDataAccess, Version=2.0.12.0, Culture=neutral, PublicKeyToken=89b483f429c47342'."
The problem is at runtime (compilation is ok).
I only downloaded the library and used it. I didn't execute any install script or something... it could be the problem?
Thanks!
Pablo
-
Hello!
Now I've tryed using NuGet and I could run the web api example.
But I have this warning:
"The package "Oracle.ManagedDataAccess 12.2.1100" was restored with ".NETFramework,Version=v4.6.1" instead of the target platform of the project ".NETCoreApp,Version=v2.0"
I couldn't found any option to change the platform version.
Thanks,
Pablo
-
You downloaded managed ODP.NET, not ODP.NET Core beta. The latest beta version shows up as "2.0.12.0" when you look at the reference properties in Visual Studio.
-
You're right. Sorry.
Now, I've downloaded the correct version and it works fine!
The only issue I've is that I have to use NutGet to add the reference. Otherwise I get "Could not load file or assembly.." when I run the solution.
Thank you,
Pablo
-
You probably hit this .NET Core bug.
It's a known .NET Core issue. One way to workaround the issue, which is use NuGet as you've seen.
-