公司内部只支持.NET CORE 2.1版本,所以采用ABP版本4.2进行功能开发,还需要修改sqlserver为MYSQL
1.安装pomelo.entityframeworkcore.mysql和Pomelo.EntityFrameworkCore.MySql.Design
工具>nuget 包管理器>管理解决方案的nuget程序包
选择entityframeworkcore和web两个项目,然后版本选择pomelo.entityframeworkcore.mysql 为2.1版本(不能选择最新3.1版本)
这里如果选择3.1版本会出现如下问题:
System.MissingMethodException: Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalParameterBuilder..ctor(Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.
at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlCommandBuilder..ctor(IDiagnosticsLogger`1 logger, IRelationalTypeMapper typeMapper)
at Microsoft.EntityFrameworkCore.Storage.Internal.MySqlCommandBuilderFactory.CreateCore(IDiagnosticsLogger`1 logger, IRelationalTypeMapper relationalTypeMapper)
at Microsoft.EntityFrameworkCore.Storage.Internal.RawSqlCommandBuilder.Build(String sql)
at Microsoft.EntityFrameworkCore.Migrations.HistoryRepository.Exists()
at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Method not found: 'Void Microsoft.EntityFrameworkCore.Storage.Internal.RelationalParameterBuilder..ctor(Microsoft.EntityFrameworkCore.Storage.IRelationalTypeMapper)'.
通过选择2.1版本后解决