我試圖在PMC中執行update-database命令,但總是得到這個錯誤味精。我知道另一篇文章基本上有同樣的錯誤,但我嘗試了所有的答案,都沒有用。
System.ArgumentNullException: 值不能是null。
Parameter name: 型別。
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)
在System.Data.Entity.Migrations.Extensions.ProjectExtensions.IsWebSiteProject(Project project)
在System.Data.Entity.Migrations.Extensions.ProjectExtensions.GetTargetDir(Project project)
at System.Data.Entity.Migrations.MigrationsDomainCommand.GetFacade(String configurationTypeName, Boolean useContextWorkingDirectory)
在System.Data.Entity.Migrations.UpdateDatabaseCommand.<>c__DisplayClass2.<.ctor>b__0()
在System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
值不能是null。
Parameter name: 型別。
BTW我正在使用VS2022預覽版。
uj5u.com熱心網友回復:
嘗試更新EntityFramework包到最新版本。 我在使用EF 6.1.3時也遇到了同樣的問題,但后來更新到6.4.4,在VS2022預覽版上運行良好。
轉載請註明出處,本文鏈接:https://www.uj5u.com/houduan/332721.html
標籤:
