Entity Framework 6 / Firebird database provider compatibility issue in Visual Studio 2013 Prof

entity-framework-6 firebird

Question

I'm using Visual Studio 2013 Professional and .Net 4.5 on Windows 7-x64. I have Firebird 2.5.4-x64 installed.

I know that others are able to use Firebird with Entity Framework 6, and I figured out several issues on my own by reading lots of blogs and stackoverflow posts. But I've tried everything I can think of and I am totally stuck. I figured before I gave up completely on using Firebird, I'd see if someone could help me figure out what I'm doing wrong.

There seems to be a lot of outdated information on how to configure firebird within visual studio, and I've tried lots of variations of them, but here is what I think was the correct process:

  • I installed FirebirdSql.Data.FirebirdClient-4.6.1.0.msi.
  • I verified that it updated GAC:

    The Global Assembly Cache contains the following assemblies:
    FirebirdSql.Data.FirebirdClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c, processorArchitecture=MSIL
    Number of items = 1
    
  • I verified that it updated in machine.config files:

    <system.data>
      <DbProviderFactories>
        <add name="Microsoft SQL Server Compact Data Provider 4.0" invariant="System.Data.SqlServerCe.4.0" description=".NET Framework Data Provider for Microsoft SQL Server Compact" type="System.Data.SqlServerCe.SqlCeProviderFactory, System.Data.SqlServerCe, Version=4.0.0.0, Culture=neutral, PublicKeyToken=89845dcd8080cc91"/>
        <add name="FirebirdClient Data Provider" invariant="FirebirdSql.Data.FirebirdClient" description=".NET Framework Data Provider for Firebird" type="FirebirdSql.Data.FirebirdClient.FirebirdClientFactory, FirebirdSql.Data.FirebirdClient, Version=4.6.1.0, Culture=neutral, PublicKeyToken=3750abcc3150b00c"/>
      </DbProviderFactories>
    </system.data>
    
  • I installed DDEXProvider-3.0.1.0.msi

  • I verified that entries were added to the registry and that the paths were correct
  • I created a new Class Library project
  • I installed the following Nuget packages:

      <package id="EntityFramework" version="6.1.3" targetFramework="net45" />
      <package id="EntityFramework.Firebird" version="4.6.1.0" targetFramework="net45" />
      <package id="FirebirdSql.Data.FirebirdClient" version="4.6.1.0" targetFramework="net45" />
    
  • I verified updates were made to the App.config file. (Besides trying the default App.config file below, I also tried using one like the one in this blog)

    <?xml version="1.0" encoding="utf-8"?>
      <configuration>
        <configSections>
          <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
        </configSections>
        <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>
    
  • I successfully built the project

  • I successfully added a connected to an existing Firebird db (the Firedbird data provider and data source showed up in the options)
  • I tried to adde a new ADO.Net Entity Data Model, using EF Designer from database option and the data connection I had just added
  • When I clicked Next I got this error:

    Your project references the latest version of Entity Framework; however,
    an Entity Framework database provider compatible with this version could
    not be found for your data connection. If you have already installed a
    compatible provider, ensure you have rebuilt your project before
    performing this action. Otherwise, exit this wizard, install a compatible
    provider, and rebuild your project before performing this action.
    

If I don't install the EntityFramework Nuget package, there is a EF 5.0 option that is enabled and I don't get this error when I use 5.0. (But I'd really like to use 6.x instead!)

Does anyone have any idea how I can get past this error? Is there something else I can look at or do to try to figure it out? Thanks for any help!

1
3
4/7/2015 11:41:53 AM

Accepted Answer

Wow! I finally figured out what was going on. I was using Manage NuGet Packages... to install the packages and it seemed like everything installed with no problem. I was following another tutorial which had me use the Package Manager Console & I got an error because my project was located on a Network Share. So, I wondered if perhaps the firebird stuff was having similar issues.

Sure enough, when I ran install-package entityframework.firebird in the console, I saw errors! That would explain why my app.config file did not get updated. And now the an Entity Framework database provider compatible with this version could not be found message makes total sense. It's too bad the Manage NuGet Packages... doesn't pop up error messages when something goes wrong! That would have saved me a ton of time.

0
4/9/2015 10:22:25 AM

Popular Answer

You're missing the entityFramework section in configuration with provider registered. When you install the EntityFramework.Firebird the settings should be added.

<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>

You can see the whole App.config here.

Also the repository might give you head start, although it's just result of basically installing NuGet packages. More details here.



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