Oracle ODP.Net With Entity Framework 6 – Entity framework database compatible provider could not be found

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

Adding two references , to my project references and they are :



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):

Install-Package EntityFramework -Version 6.1.1

And modify your web.config or web.config to use Oracle.ManagedDataAccess , by adding Provider and a valid connection string eg :

    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
    <section name="Oracle.ManagedDataAccess.Client" type="OracleInternal.Common.ODPMSectionHandler, Oracle.ManagedDataAccess, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    <!-- For more information on Entity Framework configuration, visit -->
      <context type="App.Context.Default, App.Context">
        <databaseInitializer type="MyProject.Context.Config.ContextInitializer, MyProject.Context" />
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
      <provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=, Culture=neutral, PublicKeyToken=89b483f429c47342" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    <add name="Default" providerName="Oracle.ManagedDataAccess.Client" connectionString="DATA SOURCE=XE;USER ID=User" />

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

Leave a Comment