asp.net-core - 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.
解决方案
SqlServerValueGenerationStrategy
被定义为Microsoft.EntityFrameworkCore.SqlServer.dll
in Microsoft.EntityFrameworkCore.Metadata
。
确保您安装了以下 Nuget 包Microsoft.EntityFrameworkCore.SqlServer:
Install-Package Microsoft.EntityFrameworkCore.SqlServer