Entity Framework Code First and Oracle ODAC 12c Release 3 Error

.net c# entity-framework-6 oracle

Question

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>
1
0
10/16/2014 12:00:03 PM

Popular Answer

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>
1
10/28/2014 6:18:01 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow