How do you make Entity framework 6 + Sqlite + code first work?

前端 未结 2 671
清歌不尽
清歌不尽 2021-02-07 20:53

I am trying to create a simple project to explore how Entity framework 6 code first with sqlite db provider works, but when I complite my app I get the error:

相关标签:
2条回答
  • 2021-02-07 21:48

    There is a good article for this issue: http://hintdesk.com/sqlite-with-entity-framework-code-first-and-migration/

    After reading it my consolusion is: "No, please do not use sqlite if you want EF + code first". Use SQL CE instead even though it's deprecating.

    0 讨论(0)
  • 2021-02-07 21:53

    Firstly remove the below line from the providers section :

    <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.SQLiteProviderServices, System.Data.SQLite.Linq, Version=1.0.91.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>
    

    And add below line instead of that :

    <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.SQLiteProviderServices, System.Data.SQLite.Linq" />
    

    For more info : Problems using Entity Framework 6 and SQLite

    0 讨论(0)
提交回复
热议问题