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

Unable to determine the provider name for provider factory of type #39;System.Data.SQLite.SQLiteFactory#39;. with the Nuget package version 1.0.94.1(无法确定类型为“System.Data.SQLite.SQLiteFactory的提供程序工厂的提供程序名称.使用 Nuget 包版本 1.0.94.1) - IT屋-程序员软件开发技术分享社
本文介绍了无法确定类型为“System.Data.SQLite.SQLiteFactory"的提供程序工厂的提供程序名称.使用 Nuget 包版本 1.0.94.1的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我在使用 SQLite 1.0.94.1 的 Nuget 包时遇到此错误.我摆弄了各种 app.config 部分,得到了关于这个包以前版本的类似问题的帮助,但我无法让它工作.下面是我在安装 Nuget 包后找到的 app.config.我在安装之前删除了 app.config.之后我只添加了连接字符串.

I am getting this error with the Nuget package for SQLite 1.0.94.1. I fiddled around with the various app.config sections, helped by similar questions about previous versions of this package, but I cannot get it to work. Below is the app.config as I found it after installing the Nuget package. I deleted the app.config prior to installing it. I only added the connectionstrings after that.

那么,问题出在哪里??

So, where is the problem??

<?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 consider the first ADO.NET provider in the list
          within the resulting "app.config" or "web.config" file.
    -->
    <DbProviderFactories>
      <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" />
      <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="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <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>
</configuration>

推荐答案

再添加一个提供者

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

移动

下面

<remove invariant="System.Data.SQLite"/>

并将连接字符串中的提供程序名称更改为 providerName="System.Data.SQLite.

and change the provider name to providerName="System.Data.SQLite in your connection string.

编辑:另见 http://system.data.sqlite.org/index.html/tktview/2be4298631c01be99475

这篇关于无法确定类型为“System.Data.SQLite.SQLiteFactory"的提供程序工厂的提供程序名称.使用 Nuget 包版本 1.0.94.1的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持编程学习网!

本站部分内容来源互联网,如果有图片或者内容侵犯您的权益请联系我们删除!

相关文档推荐

c# Generic Setlt;Tgt; implementation to access objects by type(按类型访问对象的C#泛型集实现)
InvalidOperationException When using Context Injection in ASP.Net Core(在ASP.NET核心中使用上下文注入时发生InvalidOperationException)
quot;Overflowquot; compiler error with -9223372036854775808L(编译器错误-9223372036854775808L(Q;溢出Q))
Visual Studio 2010 ReportViewer Assembly References(Visual Studio 2010 ReportViewer程序集引用)
Weird behaviour when I open a reportviewer in WPF(在WPF中打开报表查看器时出现奇怪的行为)
how do i pass parameters to aspnet reportviewer(如何将参数传递给aspnet report查看器)