Add-Migration Value不能为null。参数名称:语言 [英] Add-Migration Value cannot be null. Parameter name: language
本文介绍了Add-Migration Value不能为null。参数名称:语言的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
我正在尝试创建一个新的迁移,但是我得到一个System.ArgumentNullException
说:
I am trying to create a new migration but I get an System.ArgumentNullException saying:
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版本中似乎有一个错误。
It's related to the EF Core not EF6, it looks like there is a bug in the 2.1.0.preview1-final version.
- 使用dotnet ef --version检查您正在运行的版本
- 降级到Microsoft.EntityFrameworkCore.Design 2.0.1版本。
这篇关于Add-Migration Value不能为null。参数名称:语言的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文