VS 2022 执行迁移命令会报错,使用 VS 2019 即正常。
PM> EntityFramework\Add-Migration test
Both Entity Framework 6.x and Entity Framework Core commands are installed. The Entity Framework 6 version is executing. You can fully qualify the command to select which one to execute, 'EntityFramework\Add-Migration' for EF6.x and 'EntityFrameworkCore\Add-Migration' for EF Core.
System.ArgumentNullException: 值不能为 null。
参数名: type
在 System.Activator.CreateInstance(Type type, BindingFlags bindingAttr, Binder binder, Object[] args, CultureInfo culture, Object[] activationAttributes)
在 System.Activator.CreateInstance(Type type, Object[] args)
在 System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project, Int32 shellVersion)
在 System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project project)
在 System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project project)
在 System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory)
在 System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name, Boolean force, Boolean ignoreChanges)
在 System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
值不能为 null。
参数名: type
|