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 verified that it updated GAC:
The Global Assembly Cache contains the following assemblies: FirebirdSql.Data.FirebirdClient, Version=220.127.116.11, 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=18.104.22.168, 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=22.214.171.124, Culture=neutral, PublicKeyToken=3750abcc3150b00c"/> </DbProviderFactories> </system.data>
I installed DDEXProvider-126.96.36.199.msi
I installed the following Nuget packages:
<package id="EntityFramework" version="6.1.3" targetFramework="net45" /> <package id="EntityFramework.Firebird" version="188.8.131.52" targetFramework="net45" /> <package id="FirebirdSql.Data.FirebirdClient" version="184.108.40.206" 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
ADO.Net Entity Data Model, using
EF Designer from databaseoption 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!
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.
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