Entity framework EntityFramework Firebird数据库优先

Entity framework EntityFramework Firebird数据库优先,entity-framework,entity-framework-core,visual-studio-2019,firebird,firebird-.net-provider,Entity Framework,Entity Framework Core,Visual Studio 2019,Firebird,Firebird .net Provider,我正在尝试使用Nuget软件包中的Firebird EF从数据库创建模型。我正在运行以下命令: Scaffold DbContext“User=SYSDBA;Password=xxxxxxx;Database=XXXXXXXXX;DataSource=XXXXXXXXX;Port=3050;dial=3;Charset=NONE;Role=;Connection life=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;

我正在尝试使用Nuget软件包中的Firebird EF从数据库创建模型。我正在运行以下命令:

Scaffold DbContext“User=SYSDBA;Password=xxxxxxx;Database=XXXXXXXXX;DataSource=XXXXXXXXX;Port=3050;dial=3;Charset=NONE;Role=;Connection life=15;Pooling=true;MinPoolSize=0;MaxPoolSize=50;Packet Size=8192;ServerType=0;“FirebirdSql.EntityFramework.Firebird-OutputDir模型”

我得到这个错误:

`System.Reflection.TargetInvocationException: Exception has been thrown by the target of an invocation.
 ---> System.TypeLoadException: Could not load type 'Microsoft.EntityFrameworkCore.Internal.ProductInfo' from assembly 'Microsoft.EntityFrameworkCore, Version=3.1.1.0, Culture=neutral, PublicKeyToken=adb9793829ddae60'.
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor..ctor(Object reportHandler, IDictionary args)
   --- End of inner exception stack trace ---
   at System.RuntimeMethodHandle.InvokeMethod(Object target, Object[] arguments, Signature sig, Boolean constructor, Boolean wrapExceptions)
   at System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
   at System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture)
   at System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
   at System.Activator.CreateInstance(Type type, Object[] args)
   at Microsoft.EntityFrameworkCore.Tools.ReflectionOperationExecutor..ctor(String assembly, String startupAssembly, String projectDir, String dataDirectory, String rootNamespace, String language)
   at Microsoft.EntityFrameworkCore.Tools.Commands.ProjectCommandBase.CreateExecutor()
   at Microsoft.EntityFrameworkCore.Tools.Commands.DbContextScaffoldCommand.Execute()
   at Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.<>c__DisplayClass0_0.<Configure>b__0()
   at Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(String[] args)
   at Microsoft.EntityFrameworkCore.Tools.Program.Main(String[] args)
Exception has been thrown by the target of an invocation.
`System.Reflection.TargetInvocationException:调用的目标已引发异常。
--->System.TypeLoadException:无法从程序集“Microsoft.EntityFrameworkCore,Version=3.1.1.0,Culture=neutral,PublicKeyToken=adb9793829ddae60”加载类型“Microsoft.EntityFrameworkCore.Internal.ProductInfo”。
位于Microsoft.EntityFrameworkCore.Design.OperationExecutor..ctor(对象reportHandler,IDictionary参数)
---内部异常堆栈跟踪的结束---
在System.RuntimeMethodHandle.InvokeMethod(对象目标、对象[]参数、签名符号、布尔构造函数、布尔WrapeExceptions)
在System.Reflection.RuntimeConstructorInfo.Invoke(BindingFlags invokeAttr、Binder Binder、Object[]参数、CultureInfo区域性)
位于System.RuntimeType.CreateInstanceImpl(BindingFlags bindingAttr、Binder Binder、Object[]args、CultureInfo区域性)
在System.Activator.CreateInstance(类型类型、BindingFlags bindingAttr、Binder Binder、对象[]参数、CultureInfo区域性、对象[]ActivationAttribute)
位于System.Activator.CreateInstance(类型,对象[]args)
位于Microsoft.EntityFrameworkCore.Tools.ReflectionOperationExecutor..ctor(字符串汇编、字符串startupAssembly、字符串projectDir、字符串dataDirectory、字符串根命名空间、字符串语言)
在Microsoft.EntityFrameworkCore.Tools.Commands.ProjectCommandBase.CreateExecutor()中
在Microsoft.EntityFrameworkCore.Tools.Commands.DbContextScaffoldCommand.Execute()中
在Microsoft.EntityFrameworkCore.Tools.Commands.CommandBase.c__DisplayClass0_0.b_0()中
在Microsoft.DotNet.Cli.CommandLine.CommandLineApplication.Execute(字符串[]args)
位于Microsoft.EntityFrameworkCore.Tools.Program.Main(字符串[]args)
调用的目标已引发异常。

`

我已从nuget安装了此软件包Microsoft.VisualStudio.Web.CodeGeneration.Design。

您可以通过安装nuget软件包Microsoft.VisualStudio.Web.CodeGeneration.Design来解决问题,但现在我遇到了实体类问题,因为它们不是在成功运行上一个命令后生成的。这只是生成的上下文类。好的,将您所做的修复发布为答案,并就我从nuget安装的新问题提出新问题Microsoft.VisualStudio.Web.CodeGeneration.Design。现在我只在Models文件夹中创建了上下文文件,但没有任何实体类。这就是全部。没有提示错误。此问题下的是