在配置中找不到指定的存储提供程序,或者是无效的

本文关键字:程序 或者是 无效 存储 找不到 配置 | 更新日期: 2023-09-27 18:08:15

我有一个Winform应用程序和使用EntityFramework。应用程序在我的开发机器上运行得很好,但是当我试图在客户端机器上运行时,我得到"指定的存储提供程序无法在配置中找到,或者无效"错误。我已经与客户端分发了EntityFramework.dll。为什么会出现这个错误?我没有把连接字符串在app.config文件中,因为它是基于运行时选择的数据库动态创建的。(我使用的数据库是VistaDB)

app.config如下:

<configuration>
<configSections>
<section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection,EntityFramework, Version=4.4.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
</configSections>
<connectionStrings>
 </connectionStrings>
 <entityFramework>
<defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
</entityFramework>
</configuration>

在配置中找不到指定的存储提供程序,或者是无效的

我遇到了这个问题。我卸载了Connector . net并重新安装了它。

根据您使用的数据库类型,您需要提供将由Entityframe work使用的Db ORM设置

 <system.data>
    <DbProviderFactories>
      <remove invariant="MySql.Data.MySqlClient" />
      <add name="MySQL Data Provider" invariant="MySql.Data.MySqlClient" description=".Net Framework Data Provider for MySQL" type="MySql.Data.MySqlClient.MySqlClientFactory,MySql.Data" />
    </DbProviderFactories>
  </system.data>

要解决此错误,请在客户端计算机上安装Microsoft SQL Server Compact 4.0。

相关文章: