首页 新闻 会员 周边

add-migration 出错

0
[已解决问题] 解决于 2014-07-16 15:02

PM> enable-migrations
Checking if the context targets an existing database...
Code First Migrations enabled for project ConsoleApplication1.
PM> add-migration id
No MigrationSqlGenerator found for provider 'MySql.Data.MySqlClient'. Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators.
PM>

梦回周公的主页 梦回周公 | 菜鸟二级 | 园豆:218
提问于:2014-07-10 20:49
< >
分享
最佳答案
0

Use the SetSqlGenerator method in the target migrations configuration class to register additional SQL generators.

奖励园豆:5
Launcher | 高人七级 |园豆:45045 | 2014-07-11 10:09
其他回答(1)
1

  配置文件修改为:

<entityFramework codeConfigurationType="MySql.Data.Entity.MySqlEFConfiguration, MySql.Data.Entity.EF6">
    <defaultConnectionFactory type="System.Data.Entity.Infrastructure.SqlConnectionFactory, EntityFramework" />
    <providers>
      <provider invariantName="MySql.Data.MySqlClient" type="MySql.Data.MySqlClient.MySqlProviderServices, MySql.Data.Entity.EF6" />
    </providers>
  </entityFramework>

ejiyuan | 园豆:202 (菜鸟二级) | 2014-07-31 11:46
清除回答草稿
   您需要登录以后才能回答,未注册用户请先注册