繁体   English   中英

AppHarbor MVC3应用程序引发HTTP500错误

[英]AppHarbor MVC3 application throws HTTP500 error

我正在AppHarbor(http://test-1335.apphb.com)的测试站点上测试一些MVC3内容。

我的数据库在AppHarbor上运行,并且可以在手动设置MySQLConnection时访问该数据库。 可以通过单击我的网站上的“测试”来测试。

        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;
        }

通过实体框架访问数据库时,出现HTTP500错误。 可以通过单击我网站上的“驱动程序”链接进行测试。

我在AppHarbor管理页面的“错误”页面中没有任何错误,并且一切在我的开发机器上也能完美运行。

在AppHarbor上收到HTTP500错误的任何其他人,或有关如何获取有关该错误的更多详细信息的任何提示或想法?

您的站点当前显示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. 有关如何解决该问题的详细信息,请参阅问题。

我在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