Add-Migration Value cannot be null. Parameter name: language

c# entity-framework-core entity-framework-core-migrations

Question

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
1
7
3/7/2018 9:33:59 AM

Accepted Answer

It's related to the EF Core not EF6, it looks like there is a bug in the 2.1.0.preview1-final version.

  • Check the version you are running with dotnet ef --version
  • Downgrade to the Microsoft.EntityFrameworkCore.Design 2.0.1 version.
5
3/7/2018 3:54:38 PM

Popular Answer

This is issue #11075. The version of your tool doesn't match the version of your runtime. Ensure you've updated every Microsoft.EntityFrameworkCore package to 2.1.0-preview1-final.



Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow