简体   繁体   English

在IIS上使用MySQL的ASP.NET应用程序

[英]ASP.NET Application with MySQL on IIS

I want to run an ASP.Net app on an ISS-Server (Windows Server 2008). 我想在ISS服务器(Windows Server 2008)上运行ASP.Net应用程序。

I have installed the "MySQL-Connector" and the MySQL-DB. 我已经安装了“ MySQL-Connector”和MySQL-DB。 I published the ASP.Net app and copied the result into the wwwroot folder. 我发布了ASP.Net应用程序,并将结果复制到wwwroot文件夹中。

When i try to run the app, the following errormessage shows up: 当我尝试运行该应用程序时,出现以下错误消息:

Unable to find the requested .Net Framework Data Provider.  It may not be installed. 
Description: An unhandled exception occurred during the execution of the current web request. Please review the stack trace for more information about the error and where it originated in the code. 

Exception Details: System.ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.

Source Error: 

An unhandled exception was generated during the execution of the current web request. Information regarding the origin and location of the exception can be identified using the exception stack trace below.  

Stack Trace: 


[ArgumentException: Unable to find the requested .Net Framework Data Provider.  It may not be installed.]
   System.Data.Common.DbProviderFactories.GetFactory(String providerInvariantName) +1402071
   System.Data.EntityClient.EntityConnection.GetFactory(String providerString) +34

I can't fiqure out why this error is thrown, because i definitely installed the connector. 我无法弄清楚为什么会引发此错误,因为我确实安装了连接器。 Should I add something in the Web.Config or somewhere else? 我应该在Web.Config还是其他地方添加一些内容?

Does your published build contain the connector? 您发布的内部版本是否包含连接器? Check the bin folder. 检查bin文件夹。

Most likely your connector installed to the GAC on the development machine and it is not copied locally to the project, so when you do a build it just builds the site and assumes you've installed it on the server too. 您的连接器很可能安装在开发计算机上的GAC上,并且不会本地复制到项目中,因此在进行构建时,它只会构建站点并假定您也已将其安装在服务器上。

You can manually force it to copy the connector locally by selecting the reference in the Solution Explorer, right clicking and choosing Properties and set Copy Local to true. 您可以通过在解决方案资源管理器中选择引用,右键单击并选择“属性”并将“本地复制”设置为true,来手动强制其在本地复制连接器。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM