我做了什么才能到达现在的位置: 我从 http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki 安装了程序集使用 GAC 和 VS2012 选项。
我现在可以连接到现有的 SQLite 数据库,或者连接并创建一个新的 SQLite 数据库文件。
此连接将出现在我的服务器资源管理器中并且工作正常。 我可以从资源管理器中查看此数据库并更改表等。
但是,当我尝试添加一个新的ADO.NET 实体数据模型时,这个已经建立的连接将不会出现在可用的数据连接中。 即使我随后继续建立新连接,System.Data.SQLite 数据库文件 选项甚至都不在选项列表中。
我已经尝试使用 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>
类似问题:
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
我使用的是 vs2012 .NET 4.5,SQLite 版本 1.0.96.0,实体 6.1.3
我希望有人能够帮助我。
最佳答案
安装 Entity Framework 6.1.3 工具 - 从这里下载:http://www.microsoft.com/en-us/download/details.aspx?id=40762
关于c# - SQLite 连接未出现在实体数据模型向导中,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/29289701/