SQLite连接在实体数据模型向导中没有显示

10

我所做的事情以及达到目前的成果:

我按照GAC和VS2012选项从http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki安装了程序集。

现在,我可以连接到现有的SQLite数据库或创建一个新的SQLite数据库文件。

这个连接将出现在我的服务器资源管理器中,并且可以正常使用。我可以从资源管理器中查看此数据库并更改表格等内容。

但是,当我尝试添加一个新的ADO.NET实体数据模型时,这个已经建立过的连接不会出现在可用的数据连接中。 即使我继续创建一个新连接,System.Data.SQLite Database File选项也不在选项列表中。

我尝试过单独使用NuGet安装实体包或与SQLite包一起安装。我尝试过不安装它们或仅安装先前提到的程序集和实体模型的组合,但SQLite选项仍然不会出现。

经过漫长的搜索和阅读大量文章后,我发现只有少数人遇到了与我相同的问题,但没有解决方案适用于我,因此我来寻求您的帮助。

经过我所有的努力,我怀疑问题出在我的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>
  <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>

类似的问题:

使用system.data.sqlite 1.0.93创建Entity Framework 6.1.1模型的数据库优先方法

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

我使用的是vs2012.NET 4.5、SQLite版本1.0.96.0和Entity 6.1.3

希望有人能帮助我。


2
你安装了Entity Framework 6.1.3工具吗?(需要单独下载) - ErikEJ
运行得非常好,我都能亲你了。使用了以下博客 http://blogs.msdn.com/b/adonet/archive/2015/03/10/ef6-1-3-rtm-available.aspx - ImP
谢谢 - 我猜。我也在这里写了博客:http://erikej.blogspot.dk/2014/11/using-sqlite-with-entity-framework-6.html - ErikEJ
1个回答

9

1
对于Visual Studio 2015呢?我遇到了和OP一样的问题。 - JohnChris
1
@JohnChris 你看过我在这里的维基文章吗:https://github.com/ErikEJ/SqlCeToolbox/wiki/EF-Core-Power-Tools - ErikEJ
1
谢谢ErikEJ,我通过下载一些支持Visual Studio 2015的SQLite版本使其工作了。答案 我也会查看维基百科。 - JohnChris

网页内容由stack overflow 提供, 点击上面的
可以查看英文原文,
原文链接