相关疑难解决方法(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万
查看次数

带有EF6的System.data.Sqlite

我正在开发一个项目,涉及在数据库优先方法中连接SQLite和EF 6.我已经安装了System.Data.SQLite(并确保他们的DLL在GAC中),并使用NuGet将依赖项添加到我的项目中.但是,当我尝试为已存在的数据库创建模式(通过实体数据模型向导)时,我收到错误

您的项目引用了最新版本的Entity Framework; 但是,找不到与此版本兼容的Entity Framework数据库提供程序用于数据连接.在执行此操作之前,请退出此向导,安装兼容的商品并重建项目.

我已尝试过这个帖子中的答案,但是那些不涉及手工创建DAO类的修复似乎没有帮助.由于我连接的数据库非常大(模式方面),因此在代码中重新创建模式对我来说是不合理的.

我的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>
  <startup>
    <supportedRuntime version="v4.0" sku=".NETFramework,Version=v4.5.1" />
  </startup>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.91.0, Culture=neutral" />
      <provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.91.0, Culture=neutral" />
    </providers>
  </entityFramework>
  <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" />
        <remove invariant="System.Data.SQLite.EF6" />
        <add name="SQLite Data Provider (Entity …
Run Code Online (Sandbox Code Playgroud)

c# sqlite entity-framework

15
推荐指数
1
解决办法
2444
查看次数

你如何使Entity框架6 + Sqlite +代码首先工作?

我正在尝试创建一个简单的项目来探索实体框架6代码如何首先与sqlite数据库提供程序一起工作,但当我完成我的应用程序时,我得到错误:

"实体框架提供程序类型'System.Data.SQLite.SQLiteProviderServices,System.Data.SQLite.Linq,Version = 1.0.91.0,Culture = neutral,PublicKeyToken = db937bc2d44ff139'在ADO.NET提供程序的应用程序配置文件中注册无法加载不变名称'System.Data.SQLite'.请确保使用程序集限定名称并且程序集可供正在运行的应用程序使用.请参阅 http://go.microsoft.com/fwlink/?LinkId = 260882了解更多信息."

我认为这个错误与app.config文件有关.有没有人为Entity framework 6 + Sqlite 1.0.91提供有效的app.config文件?

这些是我的配置文件内容:

    <?xml version="1.0"?>
<configuration>
  <configSections>
    <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false"/>
    <!-- For more information on Entity Framework configuration, visit http://go.microsoft.com/fwlink/?LinkID=237468 -->
  </configSections>

  <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" type="System.Data.SQLite.SQLiteProviderServices, System.Data.SQLite.Linq, Version=1.0.91.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>
    </providers>
  </entityFramework>
  <connectionStrings>
    <add name="BloggingContext" connectionString="Data Source=.\animals.sqlite" providerName="System.Data.SQLite"/>
  </connectionStrings>
  <system.data>
    <DbProviderFactories>
      <remove invariant="System.Data.SQLite"/>
      <add name="SQLite Data Provider" invariant="System.Data.SQLite" description="Data Provider for …
Run Code Online (Sandbox Code Playgroud)

sqlite entity-framework

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

实体框架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万
查看次数

SQL Lite异常

我已经SQLLite在我的应用程序中生成了我的模型,但是当我尝试调用DBContextCall时它会抛出异常.

System.IO.FileLoadException发生 了类型的异常,mscorlib.dll但未在用户代码中处理

附加信息:无法加载文件或程序集'System.Data.SQLite.EF6,Version = 1.0.93.0,Culture = neutral,PublicKeyToken = db937bc2d44ff139'或其依赖项之一.定位的程序集的清单定义与程序集引用不匹配.(HRESULT异常:0x80131040)

请帮我.

.net sqlite system.data.sqlite

7
推荐指数
1
解决办法
1097
查看次数

The ADO.Net provider with Invariant name 'System.Data.SQLite.EF6' is not registered in the machine or application config file

So I've been struggling to try and get this resolved for a week or so now. When I attempt to run my application on another computer other than my development machine, I get the following error:

Schema specified is not valid. Errors: EntityFramework.RemManagerDBModel.ssdl(2,79): error 0175: The ADO.Net provider with invariant name 'System.Data.SQLite.EF6' is either not registered in the machine or application config file, or could not be loaded. See the inner exception for details.

I attempted to retrieve the inner …

.net c# sqlite winforms entity-framework-6

5
推荐指数
1
解决办法
3965
查看次数

如何在visual studio 2013中为sqlite配置实体框架6

如何在Visual Studio 2013中为Sqlite配置实体框架6.x.我想使用Entity Framework 6.x为SqLite配置我的win-form应用程序.我需要逐步描述过程.

我尝试了一些解决方案,但没有人能够直接满足特定的系统要求.有一些类似的问题,但总的来说他们要求解决他们的问题.我的观点是,我想要一个简洁的一步一步来做到这一点,这样人们就可以直接得到这个东西.

目前我已经安装了从这里为.net framework 4.5.1提供的数据和从nuget为Sqlite提供的实体框架6.0.2 .但是当我添加Ado.Net实体数据模型时,没有为Sqlite数据库连接列出提供程序.

在此输入图像描述

sqlite entity-framework .net-4.5 visual-studio-2013

3
推荐指数
1
解决办法
1923
查看次数