EF Core: The name "SqlServerValueGenerationStrategy" does not exist in the current context

asp.net-core entity-framework-core

Question

I just updated my project to ASP .NET Core 2.1 and when I run:

migrations add InitialCreate

It creates a migrations folder, but I get this error and my project won't build:

The name "SqlServerValueGenerationStrategy" does not exist in the current context.

1
31
6/5/2018 8:53:22 PM

Accepted Answer

SqlServerValueGenerationStrategy is defined into Microsoft.EntityFrameworkCore.SqlServer.dll in Microsoft.EntityFrameworkCore.Metadata.

Make sure you installed the following Nuget package Microsoft.EntityFrameworkCore.SqlServer:

Install-Package Microsoft.EntityFrameworkCore.SqlServer
81
6/5/2018 9:01:43 PM

Popular Answer

In the case of .NET Core CLI:

dotnet add package Microsoft.EntityFrameworkCore.SqlServer


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