10

What i did to get where i am: I installed the assembly from http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki using the GAC and VS2012 options.

I can now make a connection to an existing SQLite datebase or make a connection and create a new SQLite database file.

This connection will appear in my server explorer and works fine. I can look in this database from the explorer and change tables and so on.

However, when i try to add a new ADO.NET Entity Data Model this already made connection will not appear in the available data connections. Even if i then proceed in making a new connection, the System.Data.SQLite Database File option is not even in the list of options.

I have tried installing the entity package with NuGet separately or together with the SQLite packages. I have tried not installing them or only the Entity model in combination with the previously mentioned assembly, but the option for SQLite just won't appear.

After having googled and overflowed this for a frustrating amount of time and having found only a handfull of people that display the same problem as me but with no solution that works for me i come to you for help.

After all my efforts, I suspect it comes down to my App.config file. Mine looks as follows:

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <!-- For 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>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5" />
  </startup>
  <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>
  <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" />
    </DbProviderFactories>
  </system.data>
</configuration>

similar problems:

Database first create entity framework 6.1.1 model using system.data.sqlite 1.0.93

http://sqlite.1065341.n5.nabble.com/Provider-not-showing-up-in-Net-Model-import-wizard-td75306.html

I used vs2012 .NET 4.5, SQLite version 1.0.96.0, entity 6.1.3

I hope someone will be able to help me.

Community
  • 1
  • 1
ImP
  • 175
  • 1
  • 4
  • 12
  • 2
    Did you install the Entity Framework 6,1,3 Tools? (separate download) – ErikEJ Mar 27 '15 at 06:19
  • Worked like a charm. i could kiss you. used the following blog http://blogs.msdn.com/b/adonet/archive/2015/03/10/ef6-1-3-rtm-available.aspx – ImP Mar 27 '15 at 07:23
  • Thanks - I guess. I also blogged here: http://erikej.blogspot.dk/2014/11/using-sqlite-with-entity-framework-6.html – ErikEJ Mar 27 '15 at 10:27

1 Answers1

9

Install the Entity Framwork 6.1.3 Tools - download from here: http://www.microsoft.com/en-us/download/details.aspx?id=40762

ErikEJ
  • 40,951
  • 5
  • 75
  • 115
  • 1
    what about for Visual Studio 2015, I am having the same issue as OP – JohnChris Oct 02 '17 at 09:31
  • 1
    @JohnChris Have you seen my wiki article here: https://github.com/ErikEJ/SqlCeToolbox/wiki/EF-Core-Power-Tools – ErikEJ Oct 02 '17 at 12:11
  • 1
    Thanks ErikEJ, I got it to work though by downloading some sqlite version that supported visual studio 2015 [answer](https://stackoverflow.com/questions/44046937/sqlite-connection-not-appearing-in-entity-data-model-wizard-vs2015) I will cheout the wiki as well – JohnChris Oct 02 '17 at 14:01