Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Generating a data model for Oracle database fails silently or with `Failed to find or load the registered .Net Framework Data Provider` [duplicate]

I cannot get VS 2015 to create my EDMX file for an Oracle Connection.

I am using Visual Studio 2015 Update 3 I have installed the Oracle Developer Tools 12.1.0.2.4 I have installed Oracle Data Access and the following DLLs exist under \ client[user]\product\12.1.0\client\odp.net\bin 2.x\Oracle.DataAccess.dll version: 2.121.2.0 ODAC Release 4 4\Oracle.DataAccess.dll version: 4.121.2.0 ODAC Release 4 I am using the following assemblies Oracle.ManagedDataAccess Version: 4.122.1.0 Oracle.ManagedDataAccess.EntityFramework Version: 6.122.1.0 * I believe both of these are version 12.2.1100 based on the folders in which they reside in the packages folder.

There are no connections defined in the Server Explorer

My steps are as follows:

  1. Within the Solutions Explorer, Right click on project and select "Add" | "New Item..."
  2. Select Data | ADO.NET Entity Data Model | Add
  3. Select EF Designer from Database | Press Next

In the Entity Data Model Wizard:

  1. Press New Connection... (I get an warning "Failed to find the default tnsnames.ora file." I ignore and press "OK"
  2. With the Datasource as "Oracle Database (ODP.NET, Managed Driver)" I enter the credentials and specify the the other connection parameters and press "Test Connection" which SUCCEEDS.
  3. I press OK and am taken to the next page in the Entity Data Model Wizard
  4. I include sensitive data in connection string and Press Next....

WIZARD SHUTS DOWN (crashes) - NO EDMX CREATED

Any assistance in helping me troubleshoot this would be greatly appreciated.

TIA - Xavier

like image 827
xgp Avatar asked Nov 17 '22 17:11

xgp


2 Answers

Thanks to @Hong-vit pointing me in the right direction. I found the answer.

When you visit the download page for ODAC you're given a selection of version numbers.

In my case the top two were:

  • ODAC 12.2c Release 1 and Oracle Developer Tools for Visual Studio (12.2.0.1.0)
  • ODAC 12c Release 4 and Oracle Developer Tools for Visual Studio (12.1.0.2.4)

For me the top one wouldn't install. It would cut out during the installation process (thanks Oracle!) so I settled with the second one (12.1.0.2.4).

This meant that when I installed Oracle.ManagedDataAccess and Oracle.ManagedDataAccess.EntityFramework I had to select the correct version.

Not for me:

enter image description here

The one I needed

enter image description here

As you can see the version numbers (almost!) match up:

  • ODAC 12.2.0.1.0 = Oracle.ManagedDataAccess 12.2.1100
  • ODAC 12.1.0.2.4 = Oracle.ManagedDataAccess 12.1.24160719 (yay!)

I believe this is a failing on oracles behalf as it's not made clear despite their inclusion on a page long readme on which this doesn't feature. In additon the version numbers not quite being the same...but that's a rant for the blog.

like image 144
m.edmondson Avatar answered Mar 15 '23 23:03

m.edmondson


I have the same bug. I fixed it successfully by follow this step:

On your project Right click -> Select Manage NuGet packages on Browse tab input oracle. You will see Oracle.ManagedDataAccess.EntityFramework. Select version of oracle you have installed. This should be 12.1.2400. Install it, you are done

like image 29
Hong Van Vit Avatar answered Mar 15 '23 23:03

Hong Van Vit