相关疑难解决方法(0)

数据库首先使用system.data.sqlite 1.0.93创建实体框架6.1.1模型

我有一个项目,我刚刚使用nuget更新.这个更新的实体框架从6.1到6.1.1,它将sqlite更新为1.0.93.我想从我最新的数据库更新我的模型.我做了以下步骤:1)数据库模型2)选择sqlite数据库3)生成

生成后,我收到以下错误消息,如下所示.我安装了1.0.93设计时组件.有谁知道究竟是什么导致了这个错误.项目引用和版本都与上面显示的版本匹配.

错误信息:

您的项目引用了最新的实体框架; 但是,无法为您的数据连接找到与此版本兼容的Entity Framework数据库提供程序.

更新:

我最终使用包管理器控制台手动安装6.1.0

Install-Package EntityFramework -Version 6.1.0

然后在我的csporj文件中替换

包\ EntityFramework.6.1.1

包\ EntityFramework.6.1.0

我尝试从数据库和代码优先从数据库创建EF Designer但我仍然得到相同的错误.

UPDATE

我已按照汤姆提供的指示行事,感谢您抽出宝贵时间深度回应,感谢您的光临.但我不能让实体框架设计师使用SQLite 1.0.93.我发现了什么:

1)当我在Tom描述的工具菜单中添加SQLite数据源时,我看到了SQLite数据提供程序.

工具>连接到数据源

2)但是当我重新启动visual studio时,数据源没有连接

重启后连接丢失

3)数据源可以刷新,重启后有效

刷新后会显示表格

4)添加新数据项但SQLite未列为提供者

SQLite未列为提供者

我已经仔细检查了注册表,EF6被附加到不变名称,SQLite dll在GAC中注册.我会试着看看还能找到什么但是在这一点上我不知道该找什么.作为旁注,我尝试过dotConnect,但它对EF 6.1.1无效.

更新2

有没有人知道Entity Framework Designer是否有一个日志选项来找出可能发生的事情?

sqlite entity-framework

20
推荐指数
3
解决办法
3万
查看次数

无法确定"System.Data.SQLite.SQLiteFactory"类型的提供程序工厂的提供程序名称.使用Nuget包版本1.0.94.1

我在SQLite 1.0.94.1的Nuget包中遇到此错误.我对各种app.config部分进行了调整,有关此软件包以前版本的类似问题的帮助,但我无法使用它.下面是我在安装Nuget包后找到的app.config.我在安装之前删除了app.config.之后我才添加了连接字符串.

那么,问题出在哪里?

<?xml version="1.0" encoding="utf-8"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>
  <!--Added by me, the rest of the app.config was constructed by installing the SQLite package -->
  <connectionStrings>
    <add name="PrivateMessengerContext"  connectionString="DataSource=|DataDirectory|\PrivateMessengerDb.db" providerName="System.Data.SQLite.EF6"/>
    <add name="PasswordContext" connectionString="DataSource=|DataDirectory|\PasswordDb.db" providerName="System.Data.SQLite.EF6"/>
  </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 …
Run Code Online (Sandbox Code Playgroud)

.net sqlite entity-framework-6

19
推荐指数
2
解决办法
1万
查看次数

实体框架6 + SQLite

我正在尝试使用EF6 alpha和SQLite 1.0.66.0

我的.config文件:

<connectionStrings>
   <add connectionString="data source=:memory:;" name="TestDbContext" providerName="System.Data.SQLite" />
</connectionStrings>
<entityFramework>
   <providers>
      <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.SQLiteFactory, System.Data.SQLite, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
   </providers>
</entityFramework>
<runtime>
   <assemblyBinding xmlns="urn:schemas-microsoft-com:asm.v1">
     <dependentAssembly>
        <assemblyIdentity name="EntityFramework" publicKeyToken="b77a5c561934e089" culture="neutral" />
        <bindingRedirect oldVersion="0.0.0.0-5.0.0.0" newVersion="5.0.0.0" />
     </dependentAssembly>
   </assemblyBinding>
</runtime>
<system.data>
  <DbProviderFactories>
     <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, Version=1.0.66.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
  </DbProviderFactories>
</system.data>
Run Code Online (Sandbox Code Playgroud)

我跑的时候

using (var dbContext = new TestDbContext())
{
    if (dbContext.Database.Exists())
    {
        dbContext.Database.Delete();
    }
    dbContext.Database.Create();
}
Run Code Online (Sandbox Code Playgroud)

我收到一个错误:

System.InvalidOperationException:System.InvalidOperationException:实体框架提供程序类型'System.Data.SQLite.SQLiteFactory,System.Data.SQLite,Version …

sqlite ado.net entity-framework entity-framework-6

11
推荐指数
3
解决办法
3万
查看次数

SQLite连接未出现在实体数据模型向导中

我做了什么来得到我的位置:我使用GAC和VS2012选项从http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki安装了程序集.

我现在可以建立与现有SQLite数据库的连接,或者建立连接并创建新的SQLite数据库文件.

此连接将出现在我的服务器资源管理器中,并且工作正常.我可以从资源管理器中查看此数据库并更改表等.

但是,当我尝试添加新的ADO.NET实体数据模型时,这个已建立的连接将不会出现在可用的数据连接中.即使我继续进行新连接,System.Data.SQLite数据库文件选项甚至不在选项列表中.

我尝试单独使用NuGet或与SQLite包一起安装实体包.我已经尝试过不安装它们或仅将Entity模型与前面提到的程序集一起安装,但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 …
Run Code Online (Sandbox Code Playgroud)

c# database sqlite entity-framework

10
推荐指数
1
解决办法
1万
查看次数