错误,同时运行在MVC5更新,数据库 [英] Error while running Update-Database in MVC5

查看:1286
本文介绍了错误,同时运行在MVC5更新,数据库的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

我有一个MVC应用程序5,即在Azure中托管的MySQL数据库。这是工作都好,但是今天当我试图类型的更新,数据库和运行它,我得到了以下错误消息:

I have a MVC 5 app, that has MySQL database hosted in Azure. It was working all well, but today when I tried to type Update-Database and run it, I got the following error message:

System.Runtime.Serialization.SerializationException: Type is not resolved for member 'MySql.Data.MySqlClient.MySqlException,MySql.Data, Version=6.9.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'.
   at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
   at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
   at System.Data.Entity.Migrations.Design.ToolingFacade.Update(String targetMigration, Boolean force)
   at System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Type is not resolved for member 'MySql.Data.MySqlClient.MySqlException,MySql.Data, Version=6.9.3.0, Culture=neutral, PublicKeyToken=c5687fc88969c44d'.

可以采取什么问题,我怎么能解决呢?

What can be the problem, and how can I solve it?

推荐答案

我收到这样的问题:

1:安装更新MySQL连接器到新版本:<一href=\"http://dev.mysql.com/downloads/connector/net/\">http://dev.mysql.com/downloads/connector/net/

1.- Install an update the mysql connector to the new version: http://dev.mysql.com/downloads/connector/net/

2:因为您正在尝试连接到MySQL的远程安装,你必须确保该端口是开放的。您可以尝试连接到本地MySQL数据库来验证这一点。

2.- Because you are trying to connect to a remote installation of MySQL you have to make sure that the port is open. You can try to connect to a local MySQL DB to verify this.

我希望这对你的工作了。

I hope this work for you too.

这篇关于错误,同时运行在MVC5更新,数据库的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆