J'essaye de faire avec Entity Framework 5 sur SQLite (http://brice-lambson.blogspot.ru/2012/10/entity-framework-on-sqlite.html). J'ai installé SQLite et EF6. Cependant, je suis une erreur:Comment SQLite et Entity Framework 6 se combinent
Le 'instance' membre du type de fournisseur Entity Framework « System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version = 1.0.99.0, Culture = neutral, PublicKeyToken = db937bc2d44ff139 'n'a pas renvoyé un objet héritant de' System.Data.Entity.Core.Common.DbProviderServices '. Les fournisseurs Entity Framework doivent hériter de cette classe et le membre 'Instance' doit renvoyer l'instance singleton du fournisseur. Cela peut être dû au fait que le fournisseur ne prend pas en charge Entity Framework 6 ou version ultérieure;
Pouvez-vous me donner un indice quant à l'origine du problème? Merci beaucoup!
Mon fichier app.config
ressemble à ceci:
<configuration>
<configSections>
<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.5.2" />
</startup>
<entityFramework>
<defaultConnectionFactory type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6"/>
<providers>
<provider invariantName="System.Data.SQLite"
type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
<provider invariantName="System.Data.SqlClient"
type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
<provider invariantName="System.Data.SQLite.EF6"
type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
</providers>
</entityFramework>
<system.data>
<DbProviderFactories>
<remove invariant="System.Data.SQLite.EF6" />
<add name="SQLite Data Provider (Entity Framework 6)" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
<remove invariant="System.Data.SQLite" />
<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" /></DbProviderFactories>
</system.data>
<connectionStrings>
<add name="ChinookContext"
connectionString="Data Source=|DataDirectory|Chinook_Sqlite_AutoIncrementPKs.sqlite"
providerName="System.Data.SQLite"/>
</connectionStrings>
</configuration>
Je les composants suivants sont installés:
- EF 6.0.0
- System.Data.SQLite 1.0.99
- système. Data.SQLite.Core 1.0.99
- System.Data.SQLite.EF6 1.0.99
- System.Data.SQLite.Linq 1.0.99
merci d'avoir sauvé ma journée, et évitez-moi de me battre avec ces dépendances :) – cdescours