entity framework - how to use EF6 with SQLite? -
i have project, use nuget install sqlite 1.0.93.0. install ef6 , add references project. update app.config:
<?xml version="1.0" encoding="utf-8"?> <configuration> <configsections> <!-- more information on entity framework configuration, visit http://go.microsoft.com/fwlink/?linkid=237468 --> <section name="entityframework" type="system.data.entity.internal.configfile.entityframeworksection, entityframework, version=6.0.0.0, culture=neutral, publickeytoken=b77a5c561934e089" requirepermission="false" /> </configsections> <system.data> <dbproviderfactories> <remove invariant="system.data.sqlite" /> <!--<add name="sqlite data provider" invariant="system.data.sqlite" description=".net framework data provider sqlite" type="system.data.sqlite.sqlitefactory, system.data.sqlite" />--> <remove invariant="system.data.sqlite.ef6" /> <add name="sqlite data provider (entity framework 6)" invariant="system.data.sqlite.ef6" description=".net framework data provider sqlite (entity framework 6)" type="system.data.sqlite.ef6.sqliteproviderfactory, system.data.sqlite.ef6" /> </dbproviderfactories> </system.data> <entityframework> <defaultconnectionfactory type="system.data.entity.infrastructure.sqlconnectionfactory, entityframework" /> <providers> <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> </configuration> then create new connection sqlite database , try create edmx, error says project has reference newest version of ef there no compatible provider connection database. if have a compatible provider have recompile project, or if have not compatible provider have install , recompile project.
i try recompile project problem persists. don't know how install compatible provider.
if in references of project delete references entityframework.dll , entityframework.sqlserver.dll in wizard create edmx have option choose between ef6.x , ef5. have enabled option select ef5, in case use ef5 , not ef6.
how can use ef6 sqlite?
thanks.
please see if answer here works (be sure watch video) : database first create entity framework 6.1.1 model using system.data.sqlite 1.0.93
Comments
Post a Comment