迁移工作去年,但现在没有

时间:2016-04-06 17:48:59

标签: c# mysql entity-framework

迁移工作去年有效,但现在没有,我该怎么做?

错误:

  

PM>更新数据库
  指定'-Verbose'标志以查看SQL   语句被应用于目标数据库。   System.Runtime.Serialization.SerializationException:Otiponãofoi   resolvido para o associado   'MySql.Data.MySqlClient.MySqlException,MySql.Data,Version = 6.9.8.0,   Culture = neutral,PublicKeyToken = c5687fc88969c44d'。 EM   System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
  em System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner)   亚军   System.Data.Entity.Migrations.Design.ToolingFacade.Update(字符串   targetMigration,Boolean force)em   System.Data.Entity.Migrations.UpdateDatabaseCommand<> c__DisplayClass2< .ctor> b__0()   EM   System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(动作   命令)类型尚未解析为关联的   'MySql.Data.MySqlClient.MySqlException,MySql.Data,Version = 6.9.8.0,   Culture = neutral,PublicKeyToken = c5687fc88969c44d'。
  PM>

代码(部分)

<configuration>
  <configSections>
        <section name="entityFramework" type="System.Data.Entity.Internal.ConfigFile.EntityFrameworkSection, EntityFramework, Version=6.0.0.0, Culture=neutral, PublicKeyToken=b77a5c561934e089" requirePermission="false" />
  </configSections>      
  <connectionStrings>
        <add name="DefaultConnection" connectionString="Data Source=mySERVER;initial catalog=myDB;Integrated Security=false;uid=myID;pwd=myPWD;"  providerName="System.Data.SqlClient"/>
  </connectionStrings>
  <appSettings>
  <!-- I will show only if needed -->
  </appSettings>
  <system.web>
  <!-- I will show only if needed -->
  </system.web>
  <system.webServer>
    <modules>
      <!-- I will show only if needed -->
    </modules>

    <handlers>

       <!-- I will show only if needed -->
    </handlers>
 </system.webServer>
  <runtime>
  <!-- I will show only if needed -->
  </runtime>
  <system.data>
   <DbProviderFactories>
    <!-- I will show only if needed -->
   </DbProviderFactories>
  </system.data>

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

1 个答案:

答案 0 :(得分:0)

配置文件中唯一的连接字符串似乎是指向一个服务器,其中“System.Data.SqlClient”是唯一的提供者; ......堆栈跟踪对MySQL很不满。

我猜你需要提供一个支持MySQL的。

我会注意到,我没有在同一个项目中与多个提供商合作:)