mysql 数据库迁移报错:

PM> add-migration udpate2015_9_20
<span style="color:#ff0000;">未为提供程序“MySql.Data.MySqlClient”找到任何 MigrationSqlGenerator。请在目标迁移配置类中使用 SetSqlGenerator 方法以注册其他 SQL 生成器。</span>


错误的原因:

没有指定当前上线文所处的程序集

    [DbConfigurationType(typeof(MySql.Data.Entity.MySqlEFConfiguration))]
public class WLContext : DbContext
{

}
    // 摘要:     //     可将此属性置于 System.Data.Entity.DbContext 的子类上,以指示 System.Data.Entity.DbConfiguration    //     的子类,后者表示应用程序的基于代码的配置与上下文类型处于不同的程序集中。    [AttributeUsage(AttributeTargets.Class, AllowMultiple = false)]    [SuppressMessage("Microsoft.Design", "CA1019:DefineAccessorsForAttributeArguments")]    [SuppressMessage("Microsoft.Performance", "CA1813:AvoidUnsealedAttributes")]    public class DbConfigurationTypeAttribute : Attribute    {        // 摘要:         //     指示应对此应用程序的基于代码的配置使用由给定程序集限定名称表示的 System.Data.Entity.DbConfiguration 的子类。        //        // 参数:         //   configurationTypeName:        //     要使用的 System.Data.Entity.DbConfiguration 类型。        public DbConfigurationTypeAttribute(string configurationTypeName);        //        // 摘要:         //     指示应对此应用程序的基于代码的配置使用 System.Data.Entity.DbConfiguration 的给定子类。        //        // 参数:         //   configurationType:        //     要使用的 System.Data.Entity.DbConfiguration 类型。        public DbConfigurationTypeAttribute(Type configurationType);        // 摘要:         //     获取应对此应用程序的基于代码的配置使用的 System.Data.Entity.DbConfiguration 的子类。        //        // 返回结果:         //     应对此应用程序的基于代码的配置使用的 System.Data.Entity.DbConfiguration 的子类。        public Type ConfigurationType { get; }    }

更多相关文章

  1. 为什么我们应该将XMPP而不是JSON用于简单(仅文本)消息传递应用程序
  2. Android - 在一个应用程序中启动另外一个已经安装的应用程序或系
  3. Android混合应用程序:JQueryMobile ajax不支持https,但可以使用htt
  4. 第三部分:Android 应用程序接口指南---第二节:UI---第六章 对话框
  5. 如何将本机应用程序(android)与phonegap应用程序集成
  6. 为什么我的Android应用程序偶尔可以非常快地耗尽电池?
  7. 如何在android 5.0(L)中运行应用程序活动名称?
  8. Android应用程序启动过程上
  9. Java Android套接字连接。错误的IP地址导致应用程序停止响应

随机推荐

  1. PHP还能开发什么?
  2. php简单图形面积计算器的实现
  3. 直击PHP的异常和错误处理
  4. php如何实现图片上传的封装
  5. PHP中如何形成static::与new static()的
  6. 【设计模式】PHP单例模式的应用场景和实
  7. PHP中$是什么意思?
  8. PHP 10 个常见安全问题(实例讲解)
  9. 一个简单QQ群聊案例代码解析(PHP实现)
  10. php面向对象简单概括