Conexão Entity Framework + Firebird

12/09/2018

0

Olá Devs!

Estou tentando conectar uma base Firebird 2.5 com EntityFramework.
Tipo de aplicação: Console .NetFramework
Ao chegar no construtor do DBContext ele reporta o seguinte erro:

System.InvalidOperationException: 'The Entity Framework provider type 'FirebirdSql.Data.EntityFramework6.FbProviderServices, EntityFramework.Firebird' registered in the application config file for the ADO.NET provider with invariant name 'FirebirdSql.Data.FirebirdClient' could not be loaded. Make sure that the assembly-qualified name is used and that the assembly is available to the running application. See http://go.microsoft.com/fwlink/?LinkId=260882 for more information.'

Meu App.Config

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.6.1" />
  </startup>
  <entityFramework>
    <defaultConnectionFactory type="FirebirdSql.Data.EntityFramework6.FbConnectionFactory, EntityFramework.Firebird" />
    <providers>
      <provider invariantName="FirebirdSql.Data.FirebirdClient" type="FirebirdSql.Data.EntityFramework6.FbProviderServices, EntityFramework.Firebird" />
    </providers>
  </entityFramework>
  <connectionStrings>
    <add name="Escola" connectionString="User=SYSDBA;Password=masterkey;Database=D:/BaseDeDados/Escola/Escola.fdb;DataSource=localhost;Port=3050;Dialect=3;Charset=NONE;Role=;Connection lifetime=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet size=8192;ServerType=0;" providerName="FirebirdSql.Data.FirebirdClient" />
  </connectionStrings>
</configuration>


Construtor DBContext
O erro ocorre na linha 5, especificamente em
base("Escola")


namespace _2_Firebird_Entity.Dao
{
    class LinasDBContext : DbContext
    {
        public LinasDBContext() : base("Escola")
        {

        }
        public DbSet<Aluno> Alunos { get; set; }
    }
}
Igor Novaes

Igor Novaes

Responder

Utilizamos cookies para fornecer uma melhor experiência para nossos usuários, consulte nossa política de privacidade.

Aceitar