I am trying to build an MVC 5 Web application with Entity Framework 6 that works on Oracle Database , am trying to use ODAC 12c Release 3 which includes support for Entity Framework 6 Code First and Code First Migrations; NuGet, .NET Framework 4.5.2; and ODP.NET, Managed Driver XML DB. As per
http://www.oracle.com/technetwork/topics/dotnet/whatsnew/index.html
I have VS 2013 Community Edition update 4 .
Am trying to add Model using ADO.Net Entity Data Model , With Code First.
I have the following configured in my Web.config
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
<section name="Oracle.ManagedDataAccess.Client"
type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=4.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</configSections>
<entityFramework>
<contexts>
<context type="Tamayz.Context.Default, Tamayz.Context">
<databaseInitializer type="MyProject.Context.Config.ContextInitializer, MyProject.Context" />
</context>
</contexts>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
<providers>
<provider invariantName="Oracle.ManagedDataAccess.Client"
type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
</providers>
</entityFramework>
I also added Oracle.ManagedDataAccess version 4.121.2.0 as a reference and rebuild the solution.
I tried now to add Model using ADO.Net Entity Data Model , With Code First. but am getting the following message in the last screen of the wizard:
Your project references that latest version of entity framework; however, an Entity Framework database Provider compatible with this version could not be found for your connection...
How could I properly configure my application to be able to use ODAC with EF6 Code first ?
I also downgraded to 6.1.2 and all my problems with adding an Entity Model disappeared. It seems both 2015 and 2017 Visual Studio have problems with versions any higher than that. Oracle need to look at this ASAP.
I tried everything in the selected answer but I couldn't create my models. I had the same issue as @WAQ in the comments of the selected answer, where I didn't get the error message but it skipped to the table selection.
I'm using VS2017 15.7.4, Oracle 12g, and EF 6.1.1.
I decided to downgrade
Oracle.ManagedDataAccess.EntityFramework
andOracle.ManagedDataAccess
from 18.3.0 to 12.2.1100 and it finally worked!I just had this problem on visual studio 2015. In my case it was due to Entity Framework 6.1.3 not being supported. After downgrading it to 6.1.2 it's working.
Just to complement, i've tried everything but in my case it was solved by setting the "defaultConnectionFactory", like this:
found the solution here: https://community.oracle.com/message/13114643#13114643
I hope it helps someone...
I finally was able to to use ODP with EF6.
I did the following to make it work :-
First Installing ODAC 12c Release 3 which includes support for Entity Framework 6 Code First and Code First Migrations; NuGet, .NET Framework 4.5.2; and ODP.NET, Managed Driver XML DB. As per
http://www.oracle.com/technetwork/topics/dotnet/whatsnew/index.html
Adding two references , to my project references and they are :
Oracle.ManagedDataAccess.dll
Oracle.ManagedDataAccess.EntityFramework.dll
Installing EF6.1.1 using NuGet by running the following command in Package Manager Console( you can enter it by Tools->NuGet Package Manager -> Package Manager Console):
And modify your web.config or web.config to use Oracle.ManagedDataAccess , by adding Provider and a valid connection string eg :
Rebuild your Application as x86, and start using EF6 , you can check if it works by adding a model using ADO.Net Entity Model using Code First
For me, installing this Nuget packages works. https://www.nuget.org/packages/Oracle.ManagedDataAccess.EntityFramework/