简体   繁体   中英

MySQL Entity Framework Migrations

we tried to implement migrations for our code first EF5 MySQL project. But when we run the update-database command in the package manager, we get a weird error:

Anyone any idea why??

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(IEnumerable 1 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) a t System.Data.Entity.Migrations.DbMigrator.Upgrade(IEnumerable 1 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()

Try using the MySql.Data.MySqlClient API instead of System.Data.SqlClient. The DLL is located here: http://dev.mysql.com/doc/refman/5.0/en/connector-net-ref-mysqlclient.html

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM