Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Entity Data Model Wizard Crash with Oracle Connection

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 663
xgp Avatar asked Jul 13 '17 14:07

xgp


3 Answers

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 23
Hong Van Vit Avatar answered Nov 09 '22 13:11

Hong Van Vit


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 98
m.edmondson Avatar answered Nov 09 '22 13:11

m.edmondson


I had the same issue - I hope I can help fellow Googlers having the unfortunate task of connecting Oracle and Visual Studio.

I followed the steps and still got crashes - because I was using VS2017 (I understand that the questions is tagged VS2015). You'll need to install the VS2017 ODAC Client. Thankfully, this one actually does something when you begin the installation. The installer in the link on the accepted answer will only work for VS2015.

The most recent version (as of this time of writing) of ODP.NET is 18.3, which can be installed through NuGet (Oracle.ManagedDataAccess.EntityFramework). Follow these steps on Oracle's website and you'll be setup.

...Or so you think. I got the same error as in this stack overflow question, where it won't go past the Entity Data Model Wizard.

I applied every configuration in the selected answer, but it still wouldn't work. When I downgraded my Oracle.ManagedDataAccess.EntityFramework from 18.3.0 to 12.2.1100, I could finally create my models!

like image 35
chakeda Avatar answered Nov 09 '22 14:11

chakeda