【发布时间】:2012-01-02 20:39:20
【问题描述】:
我用 C# 编写了一个程序集来执行 MySQL 数据库的所有数据访问。我已经在我的 C# winform 桌面应用程序中成功使用了程序集(一个已编译的 dll)。但它只适用于安装了“MySQL Connector Net 6.4.4”的电脑。
我尝试在我的 asp.net 网站项目中使用相同的程序集。首先,我收到有关缺少连接字符串的错误。这很容易通过将 MySQL 连接字符串添加到 web.config 文件来解决。我现在收到此错误(下面列出的堆栈跟踪),我尝试将以下 dll 添加到我的 bin 文件夹以解决它,但它没有工作。
MySql.Data.dll
MySql.Data.Entity.dll
MySql.Web.dll
System.Web.HttpUnhandledException (0x80004005): Exception of type 'System.Web.HttpUnhandledException' was thrown.
---> System.ArgumentException: The specified store provider cannot be found in the configuration, or is not valid.
---> System.ArgumentException: Unable to find the requested .Net Framework Data Provider. It may not be installed. at System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) at System.Data.EntityClient.EntityConnection.GetFactory(String providerString)
--- End of inner exception stack trace
【问题讨论】:
-
连接字符串中是否有 providerName="System.Data.EntityClient" 属性?
-
是的,我只是检查确定。
标签: c# mysql entity-framework