首页 > 解决方案 > 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.

标签: asp.net-coreentity-framework-core

解决方案


SqlServerValueGenerationStrategy被定义为Microsoft.EntityFrameworkCore.SqlServer.dllin Microsoft.EntityFrameworkCore.Metadata

确保您安装了以下 Nuget 包Microsoft.EntityFrameworkCore.SqlServer

Install-Package Microsoft.EntityFrameworkCore.SqlServer

推荐阅读