小编zhn*_*cho的帖子

无法确定"System.Data.Sqlite.SqliteFactory"类型的提供程序工厂的提供程序名称

我想在我的web api项目中使用sqlite实体框架,但它始终无法正常工作,

这是我的发展环境.

1.Visual studio 2013,.net framework 4.5

  1. sqlite包版本是1.0.97,我安装在下面的包中

    system.data.sqlite,system.data.sqlite.ef6,system.data.sqlite.linq

  2. EntityFramework是6.1.3

这是我得到的例外

无法确定"System.Data.SQLite.SQLiteFactory"类型的提供程序工厂的提供程序名称.确保在应用程序配置中安装或注册了ADO.NET提供程序

这是我的webconfig

<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.LocalDbConnectionFactory, EntityFramework">
      <parameters>
        <parameter value="mssqllocaldb" />
      </parameters>
    </defaultConnectionFactory>
    <providers>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6" />  <!--type="System.Data.SQLite.EF6.SQLiteProviderServices-->
    </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" …
Run Code Online (Sandbox Code Playgroud)

c# sqlite entity-framework entity-framework-6 visual-studio-2013

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