简体   繁体   English

AspNetZero 4.6.1-实体类型“捕获”要求定义主键

[英]AspNetZero 4.6.1 - Entity Type “Capture” requires a primary key to be defined

I recently updated my version of Visual Studio to 15.8.2. 我最近将Visual Studio的版本更新为15.8.2。 I am now no longer able to build my AspNetZero MVC project. 现在,我不再能够构建我的AspNetZero MVC项目。 I get the error that Entity Type "Capture" requires a primary key. 我收到以下错误消息:实体类型“捕获”需要主键。 The problem is "Capture" exists no where within the project. 问题是“捕获”在项目中不存在。 I believe it is compiled. 我相信它已经编译。

Has anyone else with AspNetZero had this issue and knows how to fix? 使用AspNetZero的其他人是否遇到过此问题,并且知道如何解决?

From the modelBuilder debug view: 在modelBuilder调试视图中:

EntityType: Capture
Properties: 
  Discriminator (no field, string) Shadow Required AfterSave:Throw 0 0 -1 0 -1
    Annotations: 
      ValueGeneratorFactory: System.Func`3[Microsoft.EntityFrameworkCore.Metadata.IProperty,Microsoft.EntityFrameworkCore.Metadata.IEntityType,Microsoft.EntityFrameworkCore.ValueGeneration.ValueGenerator]
  GroupTempId1 (no field, Nullable<int>) Shadow FK Index 1 1 0 1 -1
  TempId (no field, Nullable<int>) Shadow Required AlternateKey AfterSave:Throw 2 2 1 2 -1
  TempId1 (no field, int) Shadow Required AlternateKey AfterSave:Throw 3 3 2 3 -1
Keys: 
  TempId
  TempId1
Foreign keys: 
  Capture {'GroupTempId1'} -> Group {'TempId1'} ToDependent: Captures
Annotations: 
  Relational:DiscriminatorProperty: Discriminator
  Relational:DiscriminatorValue: Capture
  RelationshipDiscoveryConvention:NavigationCandidates: System.Collections.Immutable.ImmutableSortedDictionary`2[System.Reflection.PropertyInfo,System.Type]

我不知道为什么会这样,但是当我从TFS的主分支中重新拉下,清理,重建并在本地播放该项目时,一切又重新开始了。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM