未找到具有固定名称“System.Data.SQLite”的 ADO.NET 提供程序的实体框架提供程序

用户代码未处理 System.InvalidOperationException
  HResult=-2146233079
  Message=未找到具有固定名称“System.Data.SQLite”的 ADO.NET 提供程序的实体框架提供程序。请确保在应用程序配置文件的“entityFramework”节中注册了该提供程序。有关详细信息,请参阅 http://go.microsoft.com/fwlink/?LinkId=260882。
  Source=EntityFramework
  StackTrace: 
     

 

webconfig

<connectionStrings>
    <add name="UserConnection" connectionString="data source=|DataDirectory|\UserRole.s3db" providerName="System.Data.SQLite"/>
    <!--<add name="UserModel" connectionString="data source=(LocalDb)\v11.0;initial catalog=UserRole.Models.UserModel;integrated security=True;MultipleActiveResultSets=True;App=EntityFramework" providerName="System.Data.SqlClient" />-->
  </connectionStrings>
  <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.93.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139"/>-->
      <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 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>
  <entityFramework>
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="v11.0" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />
      <provider invariantName="System.Data.SqlClient" type="System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer" />
    </providers>
  </entityFramework>

<provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />

改为

<provider invariantName="System.Data.SQLite" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />

时间: 2024-08-07 17:01:19

未找到具有固定名称“System.Data.SQLite”的 ADO.NET 提供程序的实体框架提供程序的相关文章

未找到具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序的实体框架 解决方案

今天在做EF ORM框架时,发生了一个异常: "无法为具有固定名称"System.Data.SqlClient"的 ADO.NET 提供程序加载在应用程序配置文件中注册的实体框架提供程序类型"System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer".请确保使用限定程序集的名称且该程序集对运行的应用程序可用." 问题原因:这是由于项目缺少对EntityF

无法为具有固定名称“System.Data.SqlClient”的 ADO.NET 提供程序加载在应用程序配置文件中注册的实体框架提供程序类型“System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer”。请确保使用限定程序集的名称且该程序集对运行的应用程序可用。有关详细信息,请参阅 http://go.m

Windows服务中程序发布之后会如下错误: 无法为具有固定名称"System.Data.SqlClient"的 ADO.NET 提供程序加载在应用程序配置文件中注册的实体框架提供程序类型"System.Data.Entity.SqlServer.SqlProviderServices, EntityFramework.SqlServer".请确保使用限定程序集的名称且该程序集对运行的应用程序可用.有关详细信息,请参阅 http://go.microsoft.com

Could not load file or assembly&#39;System.Data.SQLite.dll&#39; or one of its depedencies

[问题]  在我本机的开发环境c#连接sqlite3没有问题,可是release版本移植到其他的机器就提示Could not load file or assembly'System.Data.SQLite.dll' or one of its depedencies.找不到指定模块. [解决] 搜来搜去没找到靠谱的答案,其实最后还是自己解决的. sqlite官方的下载页面里面说了:The Visual C++ 2010 SP1 runtime for x86 and the .NET Fr

System.Data.SQLite兼容32位和64位问题

SQLite版本分的很详细,本机是64位在32位会出现问题,经过搜索找到解决方案. 这是我以前写的32位在我现在的机子上的运行报错. 类似这样的. 将当前说明文档的目录下的x64.x86目录和System.Data.SQLite.dll文件复制到您的应用程序根目录中(注意更新引用,引用System.Data.SQLite.dll即可,两目录中的不需要引用,但发布时需打包).如果是WEB网站,则复制到Bin目录下即可,发布时,也注意x64和x86一起打包发布 注意,当前的System.Data.S

IIS中发布后出现Could not load file or assembly&#39;System.Data.SQLite.dll&#39; or one of its depedencies

[问题]在我本机的开发环境c#连接sqlite3没有问题,可是release版本移植到其他的机器就提示Could not load file or assembly'System.Data.SQLite.dll' or one of its depedencies.找不到指定模块. [解决]搜来搜去没找到靠谱的答案,其实最后还是自己解决的. sqlite官方的下载页面里面说了:The Visual C++ 2010 SP1 runtime for x86 and the .NET Framewo

未能加载文件或程序集“System.Data.SQLite”

未能加载文件或程序集"System.Data.SQLite"或它的某一个依赖项.试图加载格式不正确的程序. 说明: 执行当前 Web 请求期间,出现未经处理的异常.请检查堆栈跟踪信息,以了解有关该错误以及代码中导致错误的出处的详细信息. 异常详细信息: System.BadImageFormatException: 未能加载文件或程序集"System.Data.SQLite"或它的某一个依赖项.试图加载格式不正确的程序. 源错误: 执行当前 Web 请求期间生成了未

引用64位dll时候出现 未能加载文件或程序集“System.Data.SQLite”或它的某一个依赖项。试图加载格式不正确的程序。

引用64位dll时候出现 未能加载文件或程序集“System.Data.SQLite”或它的某一个依赖项.试图加载格式不正确的程序. 需要在web.config增加配置 <startup useLegacyV2RuntimeActivationPolicy="true"> <supportedRuntime version="v4.0"/> </startup>

C#使用System.Data.SQLite操作SQLite

使用System.Data.SQLite 下载地址:http://system.data.sqlite.org/index.html/doc/trunk/www/downloads.wiki 得到System.Data.SQLite.dll添加到工程引用: 建表,插入操作 static void Main(string[] args) { SQLiteConnection conn = null; string dbPath = "Data Source =" + Environmen

System.Data.SQLite数据库简介

SQLite介绍 在介绍System.Data.SQLite之前需要介绍一下SQLite,SQLite是一个类似于Access的单机版数据库管理系统,它将所有数据库的定义(包括定义.表.索引和数据本身)都保存在一个单一的文件中.并且,SQLite是一个用C实现的类库,它在内存消耗.文件体积.简单性方面都有不错的表现,如果数据在10W条以下,查询速度也是相当快的.SQLite具有以下特征:实现多数SQL92的标准,包括事务(原子性.一致性.隔离性和持久性).触发器和大多数的复杂查询.不对插入或者更