Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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

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.

like image 534
Primico Avatar asked Jun 05 '18 20:06

Primico


2 Answers

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
like image 90
CodeNotFound Avatar answered Nov 08 '22 08:11

CodeNotFound


In the case of .NET Core CLI:

dotnet add package Microsoft.EntityFrameworkCore.SqlServer
like image 5
markus123 Avatar answered Nov 08 '22 07:11

markus123