目前我 .net core 連接 db2 資料庫 總是存在問題,有沒有厲害大牛提供一個例子,不勝感激。
以下是環境,總是存在問題:
db2 資料庫組件:ibm.data.db2.core 版本(1.3.0.100)
ibm.EntityFrameworkCore(1.3.0.100)
db2 資料庫: 安裝的產品:DB2 Express-C - DB2COPY1, 版本:DB2/NT64 10.1.0
以下是EF CODE FIRST 命中遇到的錯誤提示,好像版本有問題一樣
Add-Migration Initial
System.TypeLoadException: Method 'get_Info' in type 'IBM.EntityFrameworkCore.Infrastructure.Internal.Db2OptionsExtension' from assembly 'IBM.EntityFrameworkCore, Version=1.2.2.201, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation.
at IBM.EntityFrameworkCore.Db2DbContextOptionsExtensions.UseDb2
at ConsoleApp1.Models.OderDbContext.OnConfiguring(DbContextOptionsBuilder optionsBuilder) in C:\Users\86186\source\repos\ConsoleApp1\ConsoleApp1\Models\OderDbContext.cs:line 18
at Microsoft.EntityFrameworkCore.DbContext.get_InternalServiceProvider()
at Microsoft.EntityFrameworkCore.Infrastructure.Internal.InfrastructureExtensions.GetService[TService](IInfrastructure`1 accessor)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(Func`1 factory)
at Microsoft.EntityFrameworkCore.Design.Internal.DbContextOperations.CreateContext(String contextType)
at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.AddMigration(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name, String outputDir, String contextType)
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Method 'get_Info' in type 'IBM.EntityFrameworkCore.Infrastructure.Internal.Db2OptionsExtension' from assembly 'IBM.EntityFrameworkCore, Version=1.2.2.201, Culture=neutral, PublicKeyToken=7c307b91aa13d208' does not have an implementation.
PM> Add-Migration Initial
轉載請註明出處,本文鏈接:https://www.uj5u.com/net/29657.html
標籤:ASP.NET
上一篇:List執行緒安全問題
下一篇:【求】查找替換正則運算式
