小编som*_*st_的帖子

EF 更新数据库错误:值不能为空参数名称:类型

我尝试update-database在 PMC 中执行命令,但总是收到此错误消息。我知道另一篇文章基本上有相同的错误,但我尝试了每个答案,但没有任何效果。

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.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)

Value cannot be null.
Parameter name: type
Run Code Online (Sandbox Code Playgroud)

顺便说一句,我正在使用 VS2022 预览版。

.net c# entity-framework code-first

25
推荐指数
1
解决办法
1万
查看次数

标签 统计

.net ×1

c# ×1

code-first ×1

entity-framework ×1