CodeFirst Migrations with Oracle ProviderIncompatibleException with EF 6

Discussion of open issues, suggestions and bugs regarding Entity Framework support in ADO.NET Data providers
Post Reply
StefanAim
Posts: 9
Joined: Mon 02 Sep 2013 14:01

CodeFirst Migrations with Oracle ProviderIncompatibleException with EF 6

Post by StefanAim » Mon 25 Nov 2013 11:11

Hello,

I get following error when executing Update-Database for CodeFirst Migrations with Entity Framework 6 on devart with oracle:

Code: Select all

System.Data.Entity.Core.ProviderIncompatibleException: An error occurred while getting provider information from the database. This can be caused by Entity Framework using an incorrect connection string. Check the inner exceptions for details and ensure that the connection string is correct. ---> System.Data.Entity.Core.ProviderIncompatibleException: The provider did not return a ProviderManifestToken string. ---> System.Data.SqlClient.SqlException: A network-related or instance-specific error occurred while establishing a connection to SQL Server. The server was not found or was not accessible.
My app.Config looks as following:

Code: Select all

<?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" />
  </configSections>
  <connectionStrings>
    <add name="BlogConnectionString" connectionString="Data Source=MyDB;User Id=MyDBUser;Password=test;" providerName="Oracle.DataAccess.Client" />
  </connectionStrings>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <entityFramework>
    <providers>
      <provider 
        invariantName="Devart.Data.Oracle" 
        type="Devart.Data.Oracle.Entity.OracleEntityProviderServices, Devart.Data.Oracle.Entity, Version=7.9.333.6, Culture=neutral, PublicKeyToken=09af7300eec23701" >
      </provider>
    </providers>
    <!--defaultConnectionFactory type="Devart.Data.Oracle.OracleProviderFactory, EntityFramework" /-->
  </entityFramework>
  <system.data>
    <DbProviderFactories>
      <remove invariant="Devart.Data.Oracle" />
      <add 
        name="dotConnect for Oracle" 
        invariant="Devart.Data.Oracle" 
        description="Devart dotConnect for Oracle" 
        type="Devart.Data.Oracle.OracleProviderFactory, Devart.Data.Oracle, Version=7.9.333.0, Culture=neutral, PublicKeyToken=09af7300eec23701" />
    </DbProviderFactories>
  </system.data>
</configuration>
Thank you,
Stefan

StefanAim
Posts: 9
Joined: Mon 02 Sep 2013 14:01

Re: CodeFirst Migrations with Oracle ProviderIncompatibleException with EF 6

Post by StefanAim » Mon 25 Nov 2013 12:22

When I call
Update-Database with parameters

Code: Select all

-ConnectionString "Data Source=MyDB;User Id=MyUser;Password=test;" -ConnectionProviderName "Devart.Data.Oracle"
directly, I get an error

Code: Select all

Schema specified is not valid. Errors: 
(0,0) : error 0152: No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SqlClient'. Make sure the provider is registered in the 'entityFramework' section of the application config file.
Thanks,
Stefan

Shalex
Site Admin
Posts: 8239
Joined: Thu 14 Aug 2008 12:44

Re: CodeFirst Migrations with Oracle ProviderIncompatibleException with EF 6

Post by Shalex » Thu 28 Nov 2013 09:28

StefanAim wrote:

Code: Select all

  <connectionStrings>
    <add name="BlogConnectionString" connectionString="Data Source=MyDB;User Id=MyDBUser;Password=test;" providerName="Oracle.DataAccess.Client" />
  </connectionStrings>
Please change it to:

Code: Select all

  <connectionStrings>
    <add name="BlogConnectionString" connectionString="Data Source=MyDB;User Id=MyDBUser;Password=test;" providerName="Devart.Data.Oracle" />
  </connectionStrings>
StefanAim wrote:I get following error when executing Update-Database for CodeFirst Migrations with Entity Framework 6 on devart with oracle:...
StefanAim wrote:

Code: Select all

Devart.Data.Oracle, Version=7.9.333.0
The 6.0.0 and 6.0.1 versions of Entity Framework are supported starting from the 8.1.26 version of dotConnect for Oracle: http://www.devart.com/dotconnect/oracle ... story.html. Please upgrade. Contact our Sales department (sales at devart dot com) if your credentials to the licensed versions of dotConnect for Oracle are outdated.

If this doesn't help, send us a small test project and specify the steps we should follow to reproduce the issue in our environment.

Post Reply