[英]AspNetZero 4.6.1 - Entity Type “Capture” requires a primary key to be defined
我最近將Visual Studio的版本更新為15.8.2。 現在,我不再能夠構建我的AspNetZero MVC項目。 我收到以下錯誤消息:實體類型“捕獲”需要主鍵。 問題是“捕獲”在項目中不存在。 我相信它已經編譯。
使用AspNetZero的其他人是否遇到過此問題,並且知道如何解決?
在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.