简体   繁体   English

AppHarbor MVC3应用程序引发HTTP500错误

[英]AppHarbor MVC3 application throws HTTP500 error

I'm testing some MVC3 stuff on my test site on AppHarbor (http://test-1335.apphb.com). 我正在AppHarbor(http://test-1335.apphb.com)的测试站点上测试一些MVC3内容。

I have my database running on AppHarbor, and I'm able to access the database when manually setting up the MySQLConnection. 我的数据库在AppHarbor上运行,并且可以在手动设置MySQLConnection时访问该数据库。 This can be tested by clicking 'Test' on my website. 可以通过单击我的网站上的“测试”来测试。

        myConnectionString = "my connection string goes here...";

        try
        {
            conn = new MySql.Data.MySqlClient.MySqlConnection();
            conn.ConnectionString = myConnectionString;
            conn.Open();
            ViewBag.Response = "OK";
        }
        catch (MySql.Data.MySqlClient.MySqlException ex)
        {
            ViewBag.Response = ex.Message;
        }

When accessing the database through Entity Framework, I get a HTTP500 error. 通过实体框架访问数据库时,出现HTTP500错误。 This can be tested by clicking the 'Drivers' link on my website. 可以通过单击我网站上的“驱动程序”链接进行测试。

I don't get any errors in the Errors page in the AppHarbor admin page, and things also run perfectly on my development machine. 我在AppHarbor管理页面的“错误”页面中没有任何错误,并且一切在我的开发机器上也能完美运行。

Anyone elso who got the HTTP500 error on AppHarbor or any tips or ideas on how to get more details about the error? 在AppHarbor上收到HTTP500错误的任何其他人,或有关如何获取有关该错误的更多详细信息的任何提示或想法?

Your site is currently showing Unable to find the requested .Net Framework Data Provider. It may not be installed. 您的站点当前显示Unable to find the requested .Net Framework Data Provider. It may not be installed. Unable to find the requested .Net Framework Data Provider. It may not be installed. . See this question for details on how to resolve the problem. 有关如何解决该问题的详细信息,请参阅问题。

I removed the reference to MySql.Data in the machine.config and added code below to the web.config. 我在machine.config中删除了对MySql.Data的引用,并将以下代码添加到了web.config中。

<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,                    Version=6.5.4.0, Culture=neutral,                    PublicKeyToken=c5687fc88969c44d" />
</DbProviderFactories>

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

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