Warning: file_get_contents(/data/phpspider/zhask/data//catemap/8/design-patterns/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Sqlite 实体框架版本没有兼容的提供程序_Sqlite_Entity Framework 6 - Fatal编程技术网

Sqlite 实体框架版本没有兼容的提供程序

Sqlite 实体框架版本没有兼容的提供程序,sqlite,entity-framework-6,Sqlite,Entity Framework 6,我有一个空项目,它是用VS2013和.net 4.5.1创建的 我已经安装了在visual studio上安装设计器组件的1.0.93.0版。我不使用最新版本1.0.94.0,因为存在一个问题,无法在创建edmx模型的向导中创建新连接,因为提供程序不可用 在安装designer组件之后,我转到NuGet控制台管理器,安装SQLite的最新版本1.0.94.0。这将安装五个软件包并将我的配置文件更新为以下代码: <?xml version="1.0" encoding="utf-8"?>

我有一个空项目,它是用VS2013和.net 4.5.1创建的

我已经安装了在visual studio上安装设计器组件的1.0.93.0版。我不使用最新版本1.0.94.0,因为存在一个问题,无法在创建edmx模型的向导中创建新连接,因为提供程序不可用

在安装designer组件之后,我转到NuGet控制台管理器,安装SQLite的最新版本1.0.94.0。这将安装五个软件包并将我的配置文件更新为以下代码:

<?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.1" />
  </startup>
  <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.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>
</configuration>

还要添加所需的引用,例如EF 6.0 dll、SQLite.dll、SQLite.EF6.dll和SQLite.Linq.dll

现在我尝试创建我的edmx模型,我可以创建一个到我的SQLite数据库的新连接,然后在下一步中,我得到一条消息,说我有EF的最新版本,但我没有兼容的提供程序

我要清除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" />
  </configSections>
  <system.data>
    <DbProviderFactories>
      <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, Version=1.0.94.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
    </DbProviderFactories>
  </system.data>
  <connectionStrings>
    <add name="northwindEFEntities" connectionString="metadata=res://*/NorthwindModel.EF6.2013.csdl|res://*/NorthwindModel.EF6.2013.ssdl|res://*/NorthwindModel.EF6.2013.msl;provider=System.Data.SQLite.EF6;provider connection string=&quot;data source=.\northwindEF.db&quot;" providerName="System.Data.EntityClient" />
  </connectionStrings>
  <entityFramework>
    <providers>
      <provider invariantName="System.Data.SQLite.EF6" type="System.Data.SQLite.EF6.SQLiteProviderServices, System.Data.SQLite.EF6, Version=1.0.94.0, Culture=neutral, PublicKeyToken=db937bc2d44ff139" />
    </providers>
  </entityFramework>
</configuration>

这个配置来自我可以从SQLite网站下载的zip文件,文件SQLite-netFx451-static-binary-bundle-x64-2013-1.0.94.0.zip,它有一个EF和EF6的测试程序,它们都可以工作。但这种配置不起作用

因此,我想知道如何使用带有EF6的SQLite创建edmx模型。我做错什么了吗

非常感谢你