Ef code first EF6代码优先-值不能为null。参数名称:entitySet

Ef code first EF6代码优先-值不能为null。参数名称:entitySet,ef-code-first,entity-framework-6,Ef Code First,Entity Framework 6,我先使用实体框架代码6。我对我的实体做了一些基本的改变,现在我无法搭建脚手架。我得到下面的错误。我甚至试着将代码还原到我可以搭建脚手架的时候,我得到了相同的错误。我过去采取过一些步骤,首先完全重置代码(删除数据库,启用迁移-强制…),但这也不起作用。你知道我如何克服这个错误吗 System.ArgumentNullException: Value cannot be null. Parameter name: entitySet at System.Data.Entity.Utilitie

我先使用实体框架代码6。我对我的实体做了一些基本的改变,现在我无法搭建脚手架。我得到下面的错误。我甚至试着将代码还原到我可以搭建脚手架的时候,我得到了相同的错误。我过去采取过一些步骤,首先完全重置代码(删除数据库,启用迁移-强制…),但这也不起作用。你知道我如何克服这个错误吗

System.ArgumentNullException: Value cannot be null.
Parameter name: entitySet
   at System.Data.Entity.Utilities.Check.NotNull[T](T value, String parameterName)
   at System.Data.Entity.Core.Mapping.EntitySetMapping..ctor(EntitySet entitySet, EntityContainerMapping containerMapping)
   at System.Data.Entity.ModelConfiguration.Edm.DbDatabaseMappingExtensions.AddEntitySetMapping(DbDatabaseMapping databaseMapping, EntitySet entitySet)
   at System.Data.Entity.ModelConfiguration.Edm.Services.TableMappingGenerator.Generate(EntityType entityType, DbDatabaseMapping databaseMapping)
   at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.GenerateEntityTypes(DbDatabaseMapping databaseMapping)
   at System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.Generate(EdmModel conceptualModel)
   at System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest, DbProviderInfo providerInfo)
   at System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
   at System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
   at System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput input)
   at System.Data.Entity.Internal.LazyInternalContext.InitializeContext()
   at System.Data.Entity.Internal.LazyInternalContext.get_ModelBeingInitialized()
   at System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext context, XmlWriter writer)
   at System.Data.Entity.Utilities.DbContextExtensions.<>c__DisplayClass1.<GetModel>b__0(XmlWriter w)
   at System.Data.Entity.Utilities.DbContextExtensions.GetModel(Action`1 writeXml)
   at System.Data.Entity.Utilities.DbContextExtensions.GetModel(DbContext context)
   at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration, DbContext usersContext, DatabaseExistenceState existenceState, Boolean calledByCreateDatabase)
   at System.Data.Entity.Migrations.DbMigrator..ctor(DbMigrationsConfiguration configuration)
   at System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor(DbMigrationsConfiguration migrationsConfiguration)
   at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.Run()
   at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
   at System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)
   at System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner runner)
   at System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldInitialCreate(String language, String rootNamespace)
   at System.Data.Entity.Migrations.EnableMigrationsCommand.<>c__DisplayClass2.<.ctor>b__0()
   at System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(Action command)
Value cannot be null.
Parameter name: entitySet
System.ArgumentNullException:值不能为null。
参数名称:entitySet
在System.Data.Entity.Utilities.Check.NotNull[T](T值,字符串参数名)
位于System.Data.Entity.Core.Mapping.EntitySetMapping..ctor(EntitySet EntitySet,EntityContainerMapping containerMapping)
位于System.Data.Entity.ModelConfiguration.Edm.DbDatabaseMappingExtensions.AddEntitySetMapping(DbDatabaseMapping数据库映射,EntitySet EntitySet)
位于System.Data.Entity.ModelConfiguration.Edm.Services.TableMappingGenerator.Generate(EntityType EntityType,DbDatabaseMapping databaseMapping)
位于System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.GenerateEntityTypes(DBDatabaseMappingDatabaseMapping)
位于System.Data.Entity.ModelConfiguration.Edm.Services.DatabaseMappingGenerator.Generate(EdmModel conceptualModel)
位于System.Data.Entity.DbModelBuilder.Build(DbProviderManifest providerManifest,DbProviderInfo providerInfo)
位于System.Data.Entity.DbModelBuilder.Build(DbConnection providerConnection)
位于System.Data.Entity.Internal.LazyInternalContext.CreateModel(LazyInternalContext internalContext)
位于System.Data.Entity.Internal.RetryLazy`2.GetValue(TInput输入)
在System.Data.Entity.Internal.LazyInternalContext.InitializeContext()中
在System.Data.Entity.Internal.LazyInternalContext.get_ModelBeInInitialized()中
位于System.Data.Entity.Infrastructure.EdmxWriter.WriteEdmx(DbContext上下文,XmlWriter编写器)
在System.Data.Entity.Utilities.DbContextensions.c_uuuDisplayClass1.b_uuu0(XmlWriter w)中
位于System.Data.Entity.Utilities.DbContextensions.GetModel(操作'1 writeXml)
位于System.Data.Entity.Utilities.DbContextensions.GetModel(DbContext上下文)
位于System.Data.Entity.Migrations.Dbmigator..ctor(DbMigrationsConfiguration配置、DbContext usersContext、DatabaseExistenceEstate ExistenceEstate、称为DbyCreateDatabase的布尔值)
位于System.Data.Entity.Migrations.DbMigrator..ctor(dbmigrations配置)
位于System.Data.Entity.Migrations.Design.MigrationScaffolder..ctor(DbMigrationsConfiguration MigrationConfiguration)
位于System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldRunner.Run()处
在System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)处
在System.AppDomain.DoCallBack(CrossAppDomainDelegate callBackDelegate)处
位于System.Data.Entity.Migrations.Design.ToolingFacade.Run(BaseRunner)
位于System.Data.Entity.Migrations.Design.ToolingFacade.ScaffoldInitialCreate(字符串语言,字符串根命名空间)
在System.Data.Entity.Migrations.EnableMigrationsCommand.c__DisplayClass2.b__0()中
位于System.Data.Entity.Migrations.MigrationsDomainCommand.Execute(操作命令)
值不能为null。
参数名称:entitySet

我想出来了。有一个名称很差的实体“Timezone”,我最终删除了它,因为我不需要它。但是,我将虚拟财产“Timezone”留在了另一个实体中。VS编译得很好,因为它认为它是一个系统类,但EF代码首先抛出了一个错误