Entity framework core 无法在EF Core 5上为EntityFrameworkCore.Jet构建DbContext

Entity framework core 无法在EF Core 5上为EntityFrameworkCore.Jet构建DbContext,entity-framework-core,jet-ef-provider,Entity Framework Core,Jet Ef Provider,我想构建一个旧的ms access数据库(.mdb)。因此,我使用Visual Studio 2019为控制台应用程序创建了一个sln。然后使用nuget添加以下软件包: EntityFrameworkCore.Jet" Version="3.1.0-alpha.4" Microsoft.EntityFrameworkCore" Version="5.0.5" Microsoft.EntityFrameworkCore.Design

我想构建一个旧的ms access数据库(.mdb)。因此,我使用Visual Studio 2019为控制台应用程序创建了一个sln。然后使用nuget添加以下软件包:

EntityFrameworkCore.Jet" Version="3.1.0-alpha.4" 
Microsoft.EntityFrameworkCore" Version="5.0.5" 
Microsoft.EntityFrameworkCore.Design" Version="5.0.5"
Microsoft.EntityFrameworkCore.Relational" Version="5.0.5"
Microsoft.EntityFrameworkCore.Tools" Version="5.0.5"
在PackageManager控制台中,我输入

Scaffold DbContext-Connection“Provider=Microsoft.ACE.OLEDB.12.0;数据源=C:\Repo\Samp.mdb;Jet-OLEDB:数据库密码=**** ;“-Provider EntityFrameworkCore.Jet-OutputDir Models\Models600-verbose

命令运行时,出现以下错误:

找不到方法:“Void Microsoft.EntityFrameworkCore.Storage.DecimalTypeMapping..ctor(System.String,System.Nullable`1)”


我需要做些什么才能使其正常工作?

您需要将EF Core依赖项降级为3.1我错误地读取了它们的依赖项saw 5.0.0并移动了OneTityFrameworkCore.Jet.Data(>=3.1.0-alpha.4)Microsoft.EntityFrameworkCore(>=3.1.10&<5.0.0)Microsoft.EntityFrameworkCore.Relational(>=3.1.10&<5.0.0)