gpt4 book ai didi

c# - MySQL Entity Framework 迁移

转载 作者:行者123 更新时间:2023-11-29 13:47:40 26 4
gpt4 key购买 nike

我们尝试为我们的代码优先 EF5 MySQL 项目实现迁移。但是当我们在包管理器中运行 update-database 命令时,我们收到一个奇怪的错误:

有人知道为什么吗?

System.Data.ProviderIncompatibleException: The provider did not return a ProviderManifest instance. ---> System.ArgumentException: Could not determine storage version; a valid storage connection or a version hint is required. at System.Data.SqlClient.SqlVersionUtils.GetSqlVersion(String versionHint) at System.Data.SqlClient.SqlProviderManifest..ctor(String manifestToken) at System.Data.SqlClient.SqlProviderServices.GetDbProviderManifest(String versionHint) at System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken) --- End of inner exception stack trace --- at System.Data.Common.DbProviderServices.GetProviderManifest(String manifestToken) at System.Data.Entity.Migrations.Sql.SqlServerMigrationSqlGenerator.Generate(IEnumerable1 migrationOperations, String providerManifestToken)
at System.Data.Entity.Migrations.DbMigrator.ExecuteOperations(String migrationId, XDocument targetModel, IEnumerable
1 operations, Boolean downgrading, Boolean auto) at System.Data.Entity.Migrations.DbMigrator.ApplyMigration(DbMigration migration, DbMigration lastMigration) at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.ApplyMigration(DbMigration migration, DbMigration lastMigration) at System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable1 pendingMigrations, String targetMigrationId, String lastMigrationId)
at System.Data.Entity.Migrations.Infrastructure.MigratorLoggingDecorator.Upgrade(IEnumerable
1 pendingMigrations, String targetMigrationId, String lastMigrationId) at System.Data.Entity.Migrations.DbMigrator.Update(String targetMigration) at System.Data.Entity.Migrations.Infrastructure.MigratorBase.Update(String targetMigration) at System.Data.Entity.Migrations.Design.ToolingFacade.UpdateRunner.RunCore() at System.Data.Entity.Migrations.Design.ToolingFacade.BaseRunner.Run()

最佳答案

尝试使用 MySql.Data.MySqlClient API 而不是 System.Data.SqlClient。该 DLL 位于此处:http://dev.mysql.com/doc/refman/5.0/en/connector-net-ref-mysqlclient.html

关于c# - MySQL Entity Framework 迁移,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/17167354/

26 4 0
Copyright 2021 - 2024 cfsdn All Rights Reserved 蜀ICP备2022000587号
广告合作:1813099741@qq.com 6ren.com