加入收藏 | 设为首页 | 会员中心 | 我要投稿 李大同 (https://www.lidatong.com.cn/)- 科技、建站、经验、云计算、5G、大数据,站长网!
当前位置: 首页 > 百科 > 正文

c# – Add-Migration Value不能为null.参数名称:语言

发布时间:2020-12-15 08:26:56 所属栏目:百科 来源:网络整理
导读:我试图创建一个新的迁移,但我得到一个System.ArgumentNullException 他说: System.ArgumentNullException: Value cannot be null.Parameter name: language at Microsoft.EntityFrameworkCore.Utilities.Check.NotNull[T](T value,String parameterName) at
我试图创建一个新的迁移,但我得到一个System.ArgumentNullException
他说:
System.ArgumentNullException: Value cannot be null.
Parameter name: language
    at Microsoft.EntityFrameworkCore.Utilities.Check.NotNull[T](T value,String parameterName)
    at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations..ctor
    (IOperationReporter reporter,Assembly assembly,Assembly 
    startupAssembly,String projectDir,String rootNamespace,String 
    language)
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.<>c__DisplayClass4_0.<.ct
    or>b__4()
    at Microsoft.EntityFrameworkCore.Internal.LazyRef`1.get_Value()
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.AddMigrationImpl(String name,String outputDir,String contextType)
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.<>c__DisplayClass3_0`1.<Execute>b__0()
    at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
Value cannot be null.
Parameter name: language

解决方法

它与EF Core而不是EF6有关,看起来2.1.0.preview1-final版本中存在一个错误.
  • Check the version you are running with dotnet ef –version
  • Downgrade to the Microsoft.EntityFrameworkCore.Design 2.0.1 version.

(编辑:李大同)

【声明】本站内容均来自网络,其相关言论仅代表作者个人观点,不代表本站立场。若无意侵犯到您的权利,请及时与联系站长删除相关内容!

    推荐文章
      热点阅读