小编Tua*_*Anh的帖子

无法在 Visual Studio 2022、EF6 Code First 中运行添加迁移

我尝试在 Visual Studio 2022、EntityFramework 6 上添加迁移,但它不起作用。我收到一个错误

PM> EntityFramework\Add-Migration -ConfigurationTypeName STS.Core.Migrations.Configuration "AddCheckChanges"
System.ArgumentNullException: Value cannot be null.
Parameter name: type
   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 System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetProjectTypes(Project project, Int32 shellVersion)
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project project)
   at System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project project)
   at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory)
   at System.Data.Entity.Migrations.AddMigrationCommand.Execute(String name, Boolean force, Boolean ignoreChanges)
   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Value cannot be null.
Parameter name: type
Run Code Online (Sandbox Code Playgroud)

我需要这方面的帮助。非常感谢

c# entity-framework visual-studio-2022

2
推荐指数
1
解决办法
2989
查看次数

标签 统计

c# ×1

entity-framework ×1

visual-studio-2022 ×1