System.Data.SQLite
View Ticket
Not logged in
Ticket UUID: 2be4298631c01be99475c2672c5a8d94d16c300b
Title: EF6 Provider not working (VS 2012)
Status: Closed Type: Packaging
Severity: Important Priority: Blocker
Subsystem: NuGetPackage Resolution: Fixed
Last Modified: 2015-04-29 08:33:33
Version Found In: 1.0.95.0
User Comments:
anonymous added on 2014-09-24 13:55:13:
My Setup:
Windows 8.1 64 bit
Visual Studio 2012 professional

Steps:
Installed sqlite-netFx45-setup-bundle-x86-2012-1.0.94.0.exe
Started Visual Studio and Opened a C# test project.
Installed Nuget Package System.Data.SQLite EF6(x64/x86). This further installed two more packages.

Two paths to get different errors:
Path 1:
1. Right click project and add new item. Select ADO.net Entity Data Model and then Next to select "EF Designer from database". Click Next. The New connection button does not list SQLite Provider???

Path 2:
1. Create DBContext class and one Table class.
2. Add connection entry in app.config as follows
<add name="TestDbContext" connectionString="data source=C:\Users\...\TestDb.sqlite" providerName="System.Data.SQLite.EF6" />
I have not changed anything in app.config except above line, rest is added by nugget package.
3. Run following code
using (var db = new TestDbContext())
{
 db.TestTable1.Add(new TestTable1() { Id = 1, Title = "TestTitle" });
 db.SaveChanges();
}
4. db.TestTable1.Add line fails with following exception
Unable to determine the provider name for provider factory of type 'System.Data.SQLite.SQLiteFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.

I tried almost all suggestions given on net. Run in admin mode. rerun devenv /setup. Many other app.config suggestions. Nothing worked.

anonymous added on 2014-09-24 13:58:56:
I have installed sqlite-netFx45-setup-bundle-x86-2012-1.0.94.0.exe with option of "Install the designer components for visual studio 2012".

anonymous added on 2014-09-24 14:25:57:
I installed another nugget package. System.data.sqlite (which is not EF6 but version number is 1.0.94.1). which now allows me to add ADO.net Entity Data Model. I added model using existing database.

Now I wrote following code,
            using (var db = new TestDbEntities())
            {
                db.TestTable1.Add(new TestTable1() { Id = 1, Title = "TestTitle" });
                db.SaveChanges();
}

This code fails at line db.TestTable1.Add() with following exception,
"Unable to determine the provider name for provider factory of type 'System.Data.SQLite.SQLiteFactory'. Make sure that the ADO.NET provider is installed or registered in the application config."

mistachkin added on 2014-09-25 04:17:32:
Do the design-time EF6 components work (i.e. the wizard can generate the models)?

anonymous added on 2014-09-25 10:14:33:
Yes Wizard has generated model. I am copy pasting code generated here for your reference.

Model1.Context.cs :

    using System;
    using System.Data.Entity;
    using System.Data.Entity.Infrastructure;
    
    public partial class TestDbEntities : DbContext
    {
        public TestDbEntities()
            : base("name=TestDbEntities")
        {
        }
    
        protected override void OnModelCreating(DbModelBuilder modelBuilder)
        {
            throw new UnintentionalCodeFirstException();
        }
    
        public virtual DbSet<TestTable1> TestTable1 { get; set; }
        public virtual DbSet<Table2> Table2 { get; set; }
    }

TestTable1.cs:

    using System;
    using System.Collections.Generic;
    
    public partial class TestTable1
    {
        public long Id { get; set; }
        public string Title { get; set; }
        public Nullable<double> Value { get; set; }
    }

Table2.cs:
    using System;
    using System.Collections.Generic;
    
    public partial class Table2
    {
        public long Id { get; set; }
        public long Table1Id { get; set; }
        public double dataValue { get; set; }
    }

anonymous added on 2014-09-25 10:29:02:
The model generated is using Database first method.

Is code first approach supported by System.Data.SQLite ? Because that is also failing with same exception as above.

anonymous added on 2014-09-25 18:13:34:
Just out of doubt I created another project. Installed nugget package for System.Data.Sqlite (x64/x86) package.

Now I try to add new ADO.Net entity data model then the wizard stopped showing me SQLite provider (under Choose Data Source dialog box).
I tried creating model first and then generate database from model. There also SQLite provider is not displayed.

But same is visible if I do Tools => Connect to database.

I am getting clueless now. It was visible in one project and now not visible if I create new one. I am back to same place where I started.

Am I not following something???

mistachkin added on 2014-09-26 03:30:12:
It would be very useful to see the following sections from your configuration file(s) that deal with defining the "TestDbEntities", e.g.:

  <connectionStrings>
    <add name="northwindEFEntities" connectionString="metadata=res://*/NorthwindModel.EF6.2013.csdl|res://*/NorthwindModel.EF6.2013.ssdl|res://*/NorthwindModel.EF6.2013.msl;provider=System.Data.SQLite.EF6;provider connection string=&quot;data source=.\northwindEF.db&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <entityFramework>
    <providers>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.95.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
    </providers>
  </entityFramework>

anonymous added on 2014-09-26 06:39:22:
Here is the app.config. This is mostly created automatically. Only one line added by me which is,

    <add name="TestDbContext" connectionString="data source=C:\Users\Sachin\Documents\Sachin\Dev\Test\Test_SQLite_EF\Test_SQLite_EF\TestDb2.sqlite" providerName="System.Data.SQLite.EF6" />

This line I added to test Code First method.


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 -->
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <connectionStrings>
    <add name="TestDbContext" connectionString="data source=C:\Users\Sachin\Documents\Sachin\Dev\Test\Test_SQLite_EF\Test_SQLite_EF\TestDb2.sqlite" providerName="System.Data.SQLite.EF6" />
  <add name="TestDbEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SQLite.EF6;provider connection string=&quot;data source=C:\Users\Sachin\Documents\Sachin\Dev\Test\Test_SQLite_EF\Test_SQLite_EF\TestDb.sqlite&quot;" providerName="System.Data.EntityClient" /></connectionStrings>
  <system.data>
    <!--
        NOTE: The extra "remove" element below is to prevent the design-time
              support components within EF6 from selecting the legacy ADO.NET
              provider for SQLite (i.e. the one without any EF6 support).  It
              appears to only consider the first ADO.NET provider in the list
              within the resulting "app.config" or "web.config" file.
    -->
    <DbProviderFactories>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
      <remove invariant="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 for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
    </DbProviderFactories>
  </system.data>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <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>

anonymous added on 2014-09-26 07:42:46:
Now I have reproduced the steps properly. I am clear now, when I see SQLite provider in Wizard and when it vanishes. Please refer to following steps.

I have attached my test project here for reference.

Setps:
0. Install sqlite-netFx45-setup-bundle-x86-2012-1.0.94.0.exe. With option of installing VS 2012 design time components.
1. Create new console project in VS 2012.
2. Create a sample SQLite DB.
3. Install NuGet package System.Data.SQLite (x86/x64)(1.0.94.1). This will install 5 packages (one for EF6.1.1, one for SQLite EF, .Core, .Linq and itself).

4. This will update the App.Config as below.

<?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>
  <system.data>
    <!--
        NOTE: The extra "remove" element below is to prevent the design-time
              support components within EF6 from selecting the legacy ADO.NET
              provider for SQLite (i.e. the one without any EF6 support).  It
              appears to only consider the first ADO.NET provider in the list
              within the resulting "app.config" or "web.config" file.
    -->
    <DbProviderFactories>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
      <remove invariant="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 for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
    </DbProviderFactories>
  </system.data>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <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>

5. Now try to add "ADO.Net Entity Data Model" by right clicking project and Add New Item. Select "Ef Designer from database" option and click next. Entity Data Model Wizard is displayed. Click on the button New Connection.
********** Here is first observation **************
The SQLite provider is not displayed under Data Source List. Only Microsoft providers are listed.
*****************************

I found workaround while playing with project.
6. Remove below lines from app.config
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />
      <remove invariant="System.Data.SQLite" />

7. Now compile the code and rerun above wizard. The SQLite provider is visible to select the SQLite database.

********** Here is second observation **************
8. Fun part is, now if I introduce lines removed in step 6. again and compile code. This does not make difference. Once the SQLite provider is visible for that project then it remains visible even if I reverse step no. 6.
*****************************

9. Complete the wizard, it creates classes.

10. Write below code in main().
            using (var context = new TestSQLiteDBEntities())
            {
                var table1 = new Table1() { Id = 1, Title = "Test" };
                context.Table1.Add(table1);

                context.SaveChanges();
            }

11. At runtime, Line "context.Table1.Add(table1);" throws below exception,
"Unable to determine the provider name for provider factory of type 'System.Data.SQLite.SQLiteFactory'. Make sure that the ADO.NET provider is installed or registered in the application config."

Hope that attached project and these detailed steps help you understand the issue.

anonymous added on 2014-09-26 07:48:03:
Oh adding missing info to above details.

The config details added by wizard in app.config are as below,

<connectionStrings><add name="TestSQLiteDBEntities" connectionString="metadata=res://*/Model1.csdl|res://*/Model1.ssdl|res://*/Model1.msl;provider=System.Data.SQLite.EF6;provider connection string=&quot;data source=C:\Users\Sachin\Documents\Sachin\Dev\Test\TestSQLiteEF\TestSQLiteEF\TestSQLiteDB.sqlite&quot;" providerName="System.Data.EntityClient" /></connectionStrings>

mistachkin added on 2014-09-26 20:14:02:
In your App.Config file, remove the following line:

<add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />

anonymous added on 2014-09-26 20:26:48:
I tried removing suggested line. Does not make any difference in behavior. I still facing the same issue. Exception is thrown at line "context.Table1.Add(table1);".
I tried same my creating new project (for double confirmation). But found same observation.

anonymous added on 2014-09-26 20:43:43:
This has resolved one of two issues. The SQLite provider is not visible without issue. Previously it was not visible immediately. After removing suggested line, SQLite Provider is always visible through Wizard.

But the exception is still thrown at the line "db.Table1.Add(table1);" in below code.

            using (var db = new TestSQLite3DBEntities())
            {
                var table1 = new Table1() { Id = 1, Title = "TestTitle" };
                db.Table1.Add(table1);

                db.SaveChanges();
            }

Exception is:
Unable to determine the provider name for provider factory of type 'System.Data.SQLite.SQLiteFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.

mistachkin added on 2014-09-26 21:24:10:
Which data providers are listed in the "machine.config" (for the .NET Framework
4.0)?

mistachkin added on 2014-09-26 21:58:05:
Also, it would be great to know which System.Data.SQLite entries are present under
the following registry keys:

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0\DataProviders
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\DataProviders
HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\DataProviders

anonymous added on 2014-09-27 06:06:59:
machine.config: (under framework):

    <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="SQLite Data Provider" invariant="System.Data.SQLite.EF6" description=".NET Framework Data Provider for SQLite" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6, Version=1.0.94.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />

</DbProviderFactories>
    </system.data>

machine.config: (under framework64):
Nothing found for SQLite

Nothing found under "HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\VisualStudio\11.0" but
Please note that key found under Wow6432Node:
HKEY_LOCAL_MACHINE\SOFTWARE\Wow6432Node\Microsoft\VisualStudio\11.0\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}
AssociatedSource={0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}
CodeBase=C:\Program Files (x86)\System.Data.SQLite\2012\bin\SQLite.Designer.dll
FactoryService={dcbe6c8d-0e57-4099-a183-98ff74c64d9d}
InvariantName=System.Data.SQLite.EF6
Technology={77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}


HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0\DataProviders
This key not found on my machine.

HKEY_CURRENT_USER\Software\Microsoft\VisualStudio\11.0_Config\DataProviders\{0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c70}
AssociatedSource={0ebaab6e-ca80-4b4a-8ddf-cbe6bf058c71}
CodeBase=C:\Program Files (x86)\System.Data.SQLite\2012\bin\SQLite.Designer.dll
FactoryService={dcbe6c8d-0e57-4099-a183-98ff74c64d9d}
InvariantName=System.Data.SQLite.EF6
Technology={77ab9a9d-78b9-4ba7-91ac-873f5338f1d2}

anonymous added on 2014-09-27 06:12:54:
Please also note that the exception shows 'System.Data.SQLite.SQLiteFactory' and all the registrations we are using 'System.Data.SQLite.EF6.SQLiteProviderFactory'. Is there any connection??? I am just wild guessing; if this help :)

anonymous added on 2014-09-27 06:29:47:
Ok. Here is one more observation by which I could able to add the data without error.

I changed my App.config again and added invariant="System.Data.SQLite" and commented out "<!--remove invariant="System.Data.SQLite" /> -->" line.

This made a trick and code worked. 
But I guess there is something wrong here. For DB Design I need to remove Above line, then for running the code I need to again add that. I guess this should work only with "invariant="System.Data.SQLite.EF6"" ??? am I right ?

    <DbProviderFactories>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite"/>
      <!--remove invariant="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 for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
    </DbProviderFactories>

mistachkin added on 2014-09-27 15:39:35:
Interesting observation.  For Visual Studio 2013, making those changes ended up
making the design-time components non-functional.  I guess Visual Studio 2012
has different handling for that.  Clearly, more research is required in order to
make this work on all versions of Visual Studio.

mistachkin added on 2014-11-18 22:12:52:
Needs further research.  Setting to blocker for 1.0.95.0.

mistachkin added on 2015-01-07 04:20:49:
See check-in [573499eaf2].  Testing is still needed to determine if this will fix
the issue for Visual Studio 2012 while still allowing Visual Studio 2013 to work
as well.

mistachkin added on 2015-02-09 21:33:19:
With the latest pre-release packages, it appears that EF6 does *DOES NOT* work
for System.Data.SQLite from within Visual Studio 2012; however, it *DOES* work
from within Visual Studio 2013.  Will investigate further.

mistachkin added on 2015-02-09 21:41:14:
It looks like the following install might be a prerequisite:

  https://www.microsoft.com/en-us/download/details.aspx?id=40762

mistachkin added on 2015-02-09 21:45:04:
Yes, that solved the issue when used with the latest pre-release packages.

anonymous added on 2015-02-27 10:02:56:
I tested this again with latest 26-Feb-2015 prerelease download.

Now design time components works great without any error and as expected.

It does fail at runtime though.

My code fails giving NotSupportedException for simple
db.TestTables.Load(); statement or any first statement related to accessing DB.

Details of exceptions are:
NotSupportedException
Unable to determine the provider name for provider factory of type 'System.Data.SQLite.SQLiteFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.

Short Stack Trace: (only copied last line where it fails)
   at System.Data.Entity.Utilities.DbProviderFactoryExtensions.GetProviderInvariantName(DbProviderFactory factory)

It works without error if I add following line in App.config:
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite" />

as follows:
    <DbProviderFactories>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description=".Net Framework Data Provider for 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 for SQLite (Entity Framework 6)" type="System.Data.SQLite.EF6.SQLiteProviderFactory, System.Data.SQLite.EF6" />
    </DbProviderFactories>

The design time components works well but why runtime is failing and why it needs SQLiteFactory yet??? Just by EF6 provider the code is not working. Please look at it.

mistachkin added on 2015-02-27 20:04:33:
Please make sure your system does not have any "System.Data.SQLite" assemblies in
the GAC.  Also, double check your "machine.config" file to make sure it does not
refer to "SQLiteFactory".

anonymous added on 2015-02-28 10:26:01:
Machine.config does not have entries for SQLiteFactory but has entry for SQLiteProviderFactory.

Yes there were assemblies in GAC but those were because I installed sqlite-netFx45-setup-bundle-x86-2012-1.0.95.0.exe. I guess this is needed for support of Design Time tools. So I uninstalled it and also manually confirmed if they are not in GAC now.

After doing this step also, I am experiencing same thing.

It fails at run time giving same exception and works if I add SQLiteFactory entry in app.config.

Is this my setup related issue? As I have only machine, I can not check on another setup... Give me more inputs if I can check any other thing? I am ready to share my desktop with you if you want to remotely connect.

mistachkin added on 2015-02-28 19:47:34:
Are you using the new pre-release NuGet packages as well?  If not, could you try
them?

anonymous added on 2015-03-01 12:33:06:
Hello guys,

I tried it with VS 2012 and the latest package (28.02.2015) and it still doen't work. While I got at least the designer working with version 1.0.94, the data provider is now completely missing in the "Add EF model" dialogue again with 1.0.95

No DLLs in GAC and no entries in machine.config

As I set up a new project, it is frustrating getting stuck at the first (data access) layer already as I cannot progress.

Cheers.

mistachkin added on 2015-03-01 17:14:57:
In order to use the design-time components, you'll want to install the appropriate
setup package (in this case, the one for Visual Studio 2012):

https://system.data.sqlite.org/downloads/1.0.95.0/sqlite-netFx45-setup-bundle-x86-2012-1.0.95.0.exe

anonymous added on 2015-03-02 10:29:47:
Today, I did test again with Released version 1.0.95.0. The nu-get packet generated app.config. But still failing with same error at run time.

Below is copy of app.config, I have just added "connectionStrings" section manually.

TestDbContext db = new TestDbContext();
db.TestTables.Load(); // Failing at this line.

Details of exceptions are:
NotSupportedException
Unable to determine the provider name for provider factory of type 'System.Data.SQLite.SQLiteFactory'. Make sure that the ADO.NET provider is installed or registered in the application config.


<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>
  <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>
  <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>
  <connectionStrings>
  <add name="TestDbContext" connectionString="data source=.\TestSQLite.db" providerName="System.Data.SQLite.EF6" />
  </connectionStrings>
  </configuration>

mistachkin added on 2015-03-02 18:09:22:
Unable to reproduce with the 1.0.95.0 release.  Everything works as designed on
Windows 8 64-bit with Visual Studio 2012 Update 4 -AND- the Entity Framework 6
Tools for Visual Studio 2012 installed.

Specifically, I'm able to:

1. Install the necessary setup package.
2. Install the necessary NuGet packages.
3. Add an entity model based on an existing database.
4. Connect to and use a database at runtime.

anonymous added on 2015-03-03 08:59:53:
Yes, I also can do first three things you mentioned. Issue remained is only in fourth point.

I can always reproduce this on my setup. It may be just setup related issue. I have only one development machine so I can not test on another setup.

Is it possible for you to suggest possible troubleshooting points which might be causing this? Or remotely connect to my setup if you are interested finding this issue?

mistachkin added on 2015-03-03 15:28:39:
I suspect there may be stale information either in your registry (search for
"SQLite" and/or "System.Data.SQLite"), somewhere on your file system, or in
one of your "machine.config" files.

anonymous added on 2015-03-04 09:11:03:
I experienced the very same problem (steps 1.-3. working, 4. not) on my machine, the only difference is that I'm working with VS 2013.

But what solved step 4 for me (don't ask me why) was to add these two lines in the <DBProviderFactories> section of the app.config:

<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" />

anonymous added on 2015-03-04 11:10:49:
Yes that is the point. Adding same line does solve my problem too (if you read all comments above)... But this seems to be a bug or not expected behavior. I am little worried to use this work around as this is not expected by design.

So we have two different people at least experiencing same thing. I will check my registry and file system as suggested soon enough. Today I might now able to do it.

mistachkin added on 2015-03-04 19:19:49:
I've personally tested this scenario on two different machines, with two
different operating systems (Windows 7 32-bit and Windows 8.1 64-bit) and
it worked fine without the "app.config" modifications.  In fact, adding
those lines may (?) interfere with using the EF6 design-time support.

anonymous added on 2015-04-29 08:33:33:
I've also had this issue(Unable to determine the provider name for provider factory of type 'System.Data.SQLite.SQLiteFactory') with generated App.config and I confirm that adding those 2 "magic lines":

<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" />

does help. I've found another way to get it running, though. If you switch project target platform from 4.5.1 to 4 and reinstall nuget package you will have it all working(even if you later return it back to 4.5.1). I've tested it on Win8.1 and on *almost vanilla* Windows Server(so no stale data could be possible there). So the issue exists and the workarounds are too magic, I think.

Maybe my "new" workaround could help in understanding what could be wrong?