我在Windows 7-x64上使用Visual Studio 2013 Professional和.Net 4.5。我安裝了Firebird 2.5.4-x64。Visual Studio 2013中的實體框架6/Firebird數據庫提供程序兼容性問題教授
我知道其他人可以使用Firebird與實體框架6,我通過閱讀大量的博客和stackoverflow文章瞭解了我自己的幾個問題。但我已經嘗試過所有我能想到的事情,而且我完全陷入困境。我想,在我完全放棄使用Firebird之前,我會看到有人能幫我弄清楚我做錯了什麼。
似乎有很多關於如何在Visual Studio中配置火鳥過時的信息,我嘗試了很多很多的變化,但這裏是我的想法是正確的過程:
- 我安裝了FirebirdSql.Data.FirebirdClient-4.6.1.0.msi。
我驗證它更新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
我驗證了它的machine.config文件更新:
<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>
我安裝DDEXProvider-3.0.1.0.msi
- 我驗證了這些條目已添加到註冊表中,並且路徑正確
- 我創建了一個新
Class Library
項目 我安裝了以下的NuGet包:
<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" />
我驗證的更新到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 --> </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>
我成功地構建了項目
- 我成功添加一個連接到現有的火鳥分貝(除了嘗試一下默認值App.config文件,我使用一個像the one in this blog也試過)(該Firedbird數據提供程序和數據源顯示了在選項)
- 我試圖阿迪新
ADO.Net Entity Data Model
,使用EF Designer from database
選項和數據連接我剛剛加入 當我點擊
Next
我得到這個呃ROR: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.
如果我不安裝的EntityFramework NuGet包,還有是激活了,當我使用5.0我沒有得到這個錯誤EF 5.0選項。 (但我真的想用6.x代替!)
有沒有人有任何想法我可以通過這個錯誤?還有什麼我可以看看或做的嘗試弄清楚嗎?謝謝你的幫助!
感謝您花時間嘗試幫助@ cincura.net。我覺得在安裝nuget軟件包之後很奇怪,App.config似乎漏掉了一些東西。這就是爲什麼我在我的問題中提到我也嘗試過其他配置文件(實際上它是由您引用的同一個人)。希望有一些與我之前嘗試過的有所不同的東西,我將你鏈接的那個複製/粘貼到我的項目中,但它沒有任何作用。 –