Primico
Primico

Reputation: 2455

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.

Upvotes: 45

Views: 21427

Answers (2)

markus123
markus123

Reputation: 51

In the case of .NET Core CLI:

dotnet add package Microsoft.EntityFrameworkCore.SqlServer

Upvotes: 5

CodeNotFound
CodeNotFound

Reputation: 23200

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

Upvotes: 105

Related Questions