C# 注释';SqlServer:Include';找不到。确保已在ASP.Net MVC中添加批注

C# 注释';SqlServer:Include';找不到。确保已在ASP.Net MVC中添加批注,c#,asp.net-mvc,entity-framework,entity-framework-core,code-first,C#,Asp.net Mvc,Entity Framework,Entity Framework Core,Code First,我有一个asp.NETMVC代码优先项目。 在Nuget控制台中运行此命令时: “更新数据库” 它返回以下错误: PM> update-database Applying migration '20180623170538_natinalCode'. System.InvalidOperationException: The annotation 'SqlServer:Include' was not found. Ensure that the annotation has be

我有一个asp.NETMVC代码优先项目。 在Nuget控制台中运行此命令时:

“更新数据库”

它返回以下错误:

    PM> update-database
Applying migration '20180623170538_natinalCode'.
System.InvalidOperationException: The annotation 'SqlServer:Include' was not found. Ensure that the annotation has been added.
   at Microsoft.EntityFrameworkCore.Infrastructure.AnnotatableExtensions.GetAnnotation(IAnnotatable annotatable, String annotationName)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.<GetIndexesToRebuild>d__48.MoveNext()
   at System.Collections.Generic.List`1..ctor(IEnumerable`1 collection)
   at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(AlterColumnOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation operation, IModel model, MigrationCommandListBuilder builder)
   at Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1 operations, IModel model)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(Migration migration)
   at Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(String targetMigration)
   at Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration, String contextType)
   at Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(Action action)
The annotation 'SqlServer:Include' was not found. Ensure that the annotation has been added.
PM> 
PM>更新数据库
正在应用迁移“20180623170538\u国家代码”。
System.InvalidOperationException:找不到批注“SqlServer:Include”。确保已添加注释。
位于Microsoft.EntityFrameworkCore.Infrastructure.AnnotataTableExtensions.GetAnnotation(IAnnotatable annotatable,String annotationName)
在Microsoft.EntityFrameworkCore.Migrations.SQLServerMigrationSqlGenerator.d_u48.MoveNext()中
位于System.Collections.Generic.List`1..ctor(IEnumerable`1集合)
at System.Linq.Enumerable.ToList[TSource](IEnumerable`1 source)
位于Microsoft.EntityFrameworkCore.Migrations.SQLServerMigrationSqlGenerator.Generate(AlterColumnOperation操作、IModel模型、MigrationCommandListBuilder生成器)
位于Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(MigrationOperation操作、IModel模型、MigrationCommandListBuilder生成器)
位于Microsoft.EntityFrameworkCore.Migrations.MigrationsSqlGenerator.Generate(IReadOnlyList`1操作,IModel模型)
位于Microsoft.EntityFrameworkCore.Migrations.SqlServerMigrationsSqlGenerator.Generate(IReadOnlyList`1操作,IModel模型)
位于Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.GenerateUpSql(迁移)
位于Microsoft.EntityFrameworkCore.Migrations.Internal.Migrator.Migrate(字符串targetMigration)
位于Microsoft.EntityFrameworkCore.Design.Internal.MigrationsOperations.UpdateDatabase(String targetMigration,String contextType)
位于Microsoft.EntityFrameworkCore.Design.OperationExecutor.OperationBase.Execute(操作)
找不到批注“SqlServer:Include”。确保已添加注释。
PM>
这个项目不是核心…

我该怎么办


感谢您的回复…

更新Microsoft.EntityFrameworkCore,Microsoft.EntityFrameworkCore.SqlServer和Microsoft.EntityFrameworkCore.Tools到2.2.0或更高版本:)

您在哪里包含了
“SqlServer:Include”
?@LinkedListT我在我的项目中没有找到“SqlServer:Include”。您也可以将更改后的模型添加到问题中吗?!