【问题标题】:Migrations worked last year, but now it does not迁移去年奏效了,但现在没有了
【发布时间】:2016-07-27 07:10:36
【问题描述】:

去年迁移成功了,但现在不行了,我该怎么办?

错误:

PM> 更新数据库
指定“-Verbose”标志以查看 SQL 应用于目标数据库的语句。 System.Runtime.Serialization.SerializationException: O 提示 resolvido para o associado 'MySql.Data.MySqlClient.MySqlException,MySql.Data,版本=6.9.8.0, 文化=中性,PublicKeyToken=c5687fc88969c44d'。时间 System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
em System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner 亚军)他们 System.Data.Entity.Migrations.Design.ToolingFacade.Update(字符串 targetMigration,布尔力)em System.Data.Entity.Migrations.UpdateDatabaseCommand.c__DisplayClass2.<.ctor>b__0() 时间 System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(操作 命令)类型尚未解析为关联的 'MySql.Data.MySqlClient.MySqlException,MySql.Data,版本=6.9.8.0, 文化=中性,PublicKeyToken=c5687fc88969c44d'。
下午>

代码(部分)

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

【问题讨论】:

  • 你能提供O tipo não foi resolvido para o associado的翻译吗?
  • 哦,对不起:)
  • 检查一下,可能重复:stackoverflow.com/questions/26806753/…
  • @DavidOesterreich 现在我收到错误 The provider did not return a ProviderManifestToken string.
  • 这是内部异常吗?如果不能,请分享...似乎登录失败。

标签: c# mysql entity-framework


【解决方案1】:

似乎你在配置文件中唯一的连接字符串,是指向一个以“System.Data.SqlClient”作为唯一提供者的服务器; ...而且堆栈跟踪为 MySQL 哭泣。

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

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

【讨论】:

    猜你喜欢
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 1970-01-01
    • 2021-12-17
    • 2013-03-06
    • 1970-01-01
    相关资源
    最近更新 更多