0

A bit stumped with this one...

I'm receiving the following error when setting up Code First on Entity Framework and Oracle...

No Entity Framework provider found for the ADO.NET provider with invariant name 'Oracle.ManagedDataAccess.Client'. Make sure the provider is registered in the 'entityFramework' section of the application config file.

With the following setup...

Entity Framework 6.1.1

ODAC 12c Release 3

Any ideas on how to fix this problem?

I've included the app.config file below...

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>

    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 --></configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
   <connectionStrings>
    <add name="Context" connectionString="DATA SOURCE=****;PASSWORD=****;PERSIST SECURITY INFO=True;POOLING=False;USER ID=SYSTEM" providerName="Oracle.ManagedDataAccess.Client" />
  </connectionStrings> 
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>
</configuration>
swuk
  • 883
  • 6
  • 14
  • personally, I ended up using EF6.1.0, which is not the question you asked. But to figure that bit out, I uninstalled everything I added by hand and then used NuGet to do the install for me. When it did, it added all the sections to my web.config and grabbed the versions with which it was compatible. Now, if only i could get the EDM Wizard to work with other schemas... – Mike_Matthews_II May 04 '15 at 16:45

3 Answers3

1

since you have used a providerName Oracle.ManagedDataAccess.Client in connectionString. you need to add a line in following section to define it:

<providers>  
<provider invariantName="Oracle.ManagedDataAccess.Client" type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices,OracleManagedDataAccess.EntityFramework" />
</providers>
0

Am trying to do the same . but not working with me either , Did you managed to make it work ?

Try to add the provider to your config file :

   <providers>
      <provider invariantName="Oracle.ManagedDataAccess.Client" 
                type="Oracle.ManagedDataAccess.EntityFramework.EFOracleProviderServices, Oracle.ManagedDataAccess.EntityFramework, Version=6.121.1.0, Culture=neutral, PublicKeyToken=89b483f429c47342" />
    </providers>

Also check this link https://community.oracle.com/message/12679686

Wasef Anabtawi
  • 1,011
  • 1
  • 10
  • 17
0

After messing today for a few hours with the same error I found that I missed to select the correct T4 templates (see step #3)

  1. Install "ODAC 12c Release 3 and Oracle Developer Tools for Visual Studio"

    Btw. I found this note on a Oracle website:

    Note: If you have installed ODAC 12c Release 3 configured on a machine-wide level, you will see an error when trying to generate database scripts using Entity Framework Model-First. To resolve this issue, use an ODAC version later than this release or reinstall ODAC 12c Release 3 with the "Configure ODP.NET at a machine-wide level" box UNchecked.

  2. Add those nuget packages to you project:

    • EntityFramework (6.1.3 here)
    • Offical Oracle ODP.NET, Managed Entity Framework Driver (12.1.022 here)

    Those will also add some dependent packages and insert the necessary configuration into the App.config.

  3. Before generating the database, choose the correct T4 templates in the properties of the EDMX model before generating the database.

enter image description here

The pre-selected templates are designed for MS SQL Server (I guess).

al-bex
  • 666
  • 1
  • 9
  • 24