微信公众号搜"智元新知"关注
微信扫一扫可直接关注哦!

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

我试图创建一个新的迁移,但我得到一个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.

版权声明:本文内容由互联网用户自发贡献,该文观点与技术仅代表作者本人。本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌侵权/违法违规的内容, 请发送邮件至 dio@foxmail.com 举报,一经查实,本站将立刻删除。

相关推荐