为了账号安全,请及时绑定邮箱和手机立即绑定

添加迁移不适用于MySQL

添加迁移不适用于MySQL

C#
一只萌萌小番薯 2021-05-20 17:09:37
我已经从https://aspnetboilerplate.com/Templates下载了Asp.Net MVC 5.x单页Web应用程序。我正在使用MySQL,并按照链接https://aspnetboilerplate.com/Pages/Documents/EF-MySql-Integration中提到的步骤进行操作。但是,当我运行Add-Migration命令时,它给出了错误。MyCompany.MyProject.Web \ Web.Config:<add name="Default" connectionString="Server=127.0.0.1;port=3306;Database=SparTestDb;uid=root;password=root" providerName="MySql.Data.MySqlClient"/>MyCompany.MyProject.EntityFramework \ Migrations \ Configuration.cspublic Configuration(){    AutomaticMigrationsEnabled = false;    ContextKey = "Spar";    SetSqlGenerator("MySql.Data.MySqlClient", new MySql.Data.Entity.MySqlMigrationSqlGenerator());}错误:PM> Add-Migration“ AbpZero_Initial” System.NullReferenceException:对象引用未设置为对象的实例。在System.Data.Entity.Core.Common.DbProviderServices.GetProviderManifestToken(DbConnection连接)在MySql.Data.MySqlClient.MySqlProviderServices.GetDbProviderManifestToken(DbConnection连接) )在System.Data.Entity.Infrastructure.DefaultManifestTokenResolver。<> c__DisplayClass1.b__0(Tuple 3  k)    at  System.Collections.Concurrent.ConcurrentDictionary2.GetOrAdd(TKey键,Func 2 valueFactory)    at  System.Data.Entity.Infrastructure.DefaultManifestTokenResolver.ResolveManifestToken(DbConnection  connection)    at  System.Data.Entity.Utilities.DbConnectionExtensions.GetProviderInfo(DbConnection  connection, DbProviderManifest& providerManifest)    at  System.Data.Entity.DbModelBuilder.Build(DbConnection  providerConnection)    at  System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext  internalContext)    at  System.Data.Entity.Internal.RetryLazy2.GetValue(TInput输入)在System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
查看完整描述

1 回答

  • 1 回答
  • 0 关注
  • 157 浏览

添加回答

举报

0/150
提交
取消
意见反馈 帮助中心 APP下载
官方微信