title: Trouble using SQLite 1.0.92 with Entity Framework 6.1
body: <p>I'm trying to use Entity Framework with a SQLite database file, but can't make it work.</p>
  
  <p>I'm using Visual Studio 2012, SQLite 1.0.92, and Entity Framework 6.1.</p>
  
  <p>The edmx diagram correctly displays my tables, so I guess the mapping works, but when I try to do :</p>
  
  <pre><code>_Context = new DataContext();
  var test = _Context.Set&lt;T&gt;().ToList();
  </code></pre>
  
  <p>I get the following exception :</p>
  
  <blockquote>
    <p>No Entity Framework provider found for the ADO.NET provider with invariant name 'System.Data.SQLite'. Make sure the provider is registered in the 'entityFramework' section of the application config file. See <a href="http://go.microsoft.com/fwlink/?LinkId=260882" rel="nofollow noreferrer">http://go.microsoft.com/fwlink/?LinkId=260882</a> for more information.</p>
  </blockquote>
  
  <p>As suggested in other SO posts, I tried adding this in my DbContext constructor to make sure the dll is copied :</p>
  
  <pre><code>var ensureDLLIsCopied = System.Data.Entity.SqlServer.SqlProviderServices.Instance;
  </code></pre>
  
  <p>The result is that instead of throwing and exception, my program just hangs forever.</p>
  
  <p>I aslo tried to change the app.config file as suggested <a href="https://stackoverflow.com/questions/22572433/sqlite-entity-framework-ado-net-provider-error-1-0-92-0">here</a> and in <a href="https://stackoverflow.com/questions/20460357/problems-using-entity-framework-6-and-sqlite">this post</a>'s accepted answer, but no changes.</p>
  
  <p>Any ideas?</p>
  
  <p>Thank you</p>
  
  <hr>
  
  <p><strong>Edit :</strong> </p>
  
  <p>I changed my DbContext from this :</p>
  
  <pre><code>public class DataContext : DbContext { }
  </code></pre>
  
  <p>to this :</p>
  
  <pre><code>public class DataContext : DbContext 
  { 
      public DataContext() : base("name=Entities") { }
  }
  </code></pre>
  
  <p>Now, the exception I get is :</p>
  
  <blockquote>
    <p>Cannot find 'Entities' connection string in the application configuration file</p>
  </blockquote>
  
  <p>But the 'Entities' connection string <em>is</em> in app.config :</p>
  
  <pre><code>&lt;add name="Entities" 
   connectionString="metadata=res://*/Entities.Model.csdl|res://*/Entities.Model.ssdl|res://*/Entities.Model.msl;provider=System.Data.SQLite;provider connection string=&amp;quot;data source=mypath\dbname.db&amp;quot;"
   providerName="System.Data.EntityClient" /&gt;
  </code></pre>