Firebird error with Entity Framework and C#

Asked

Viewed 167 times

0

I’m trying to use Firebird with Entity Framework in C#, but when I create relationships and try to give Update-Database in Migration gives this error:

Type is not resolved for member 'FirebirdSql.Data.FirebirdClient.FbException,FirebirdSql.Data.FirebirdClient, Version=4.10.0.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c'.

My App.config is like this:

<?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.2" />
</startup>
<entityFramework>
  <defaultConnectionFactory type="FirebirdSql.Data.EntityFramework6.FbConnectionFactory, EntityFramework.Firebird" />
  <providers>
     <provider invariantName="FirebirdSql.Data.FirebirdClient" type="FirebirdSql.Data.EntityFramework6.FbProviderServices, EntityFramework.Firebird" />
     <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
  </providers>
</entityFramework>
<runtime>
  <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
    <dependentAssembly>
      <assemblyIdentity name="FirebirdSql.Data.FirebirdClient" publicKeyToken="3750abcc3150b00c" culture="neutral" />
      <bindingRedirect oldVersion="0.0.0.0-4.5.0.0" newVersion="4.5.0.0" />
    </dependentAssembly>
  </assemblyBinding>
</runtime>
<system.data>
    <DbProviderFactories>
        <remove invariant="FirebirdSql.Data.FirebirdClient" />
        <add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".NET Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient" />
    </DbProviderFactories>
</system.data>
</configuration>

Is there any solution?

  • How’s your Web.config?

  • In case I use App.config, I added it to the question.

  • Why do you have two providers on entityFramework?

  • Dude I don’t know, because the app.config was generated automatically and I didn’t even change anything.

  • 1

    @Romaniomorrisonmendez when you install EF it automatically registers Sqlclient, when you install Firebird it installs the second.

  • 1

    @Andrémoraismartins which EF version you are using ?

  • 1

    I think your FirebirdClient this in the VS 6 and your NETFramework,Version=v4.5.2"

  • Following a tutorial I found on the internet, I downloaded 3 packages by nuget: Entityframework (Version 6.1.3), Firebirdsql.Data.Firebirdclient and Entityframework.Firebird (Both in version 4.10.0)

Show 3 more comments
No answers

Browser other questions tagged

You are not signed in. Login or sign up in order to post.