EF6 MySQL StrongTypingException表TableDetails中IsPrimaryKey列的值为DBNull

EF6 MySQL StrongTypingException表TableDetails中IsPrimaryKey列的值为DBNull,mysql,asp.net-mvc-5,entity-framework-6,visual-studio-2015,Mysql,Asp.net Mvc 5,Entity Framework 6,Visual Studio 2015,我们在VS2015中使用MySql和实体框架 我们已经将必要的库导入到项目MySQLWeb、MySQL.Data、MySQL.Data.Emtity.EF6中 我遇到的问题是,当我创建ADO.net实体数据模型时,会遇到以下错误。有人能给我引路吗 由于以下异常,无法生成模型: 'System.Data.StrongTypingException:列的值 表“TableDetails”中的“IsPrimaryKey”为DBNull。--> System.InvalidCastException:指

我们在VS2015中使用MySql和实体框架

我们已经将必要的库导入到项目MySQLWeb、MySQL.Data、MySQL.Data.Emtity.EF6中

我遇到的问题是,当我创建ADO.net实体数据模型时,会遇到以下错误。有人能给我引路吗

由于以下异常,无法生成模型:

'System.Data.StrongTypingException:列的值 表“TableDetails”中的“IsPrimaryKey”为DBNull。--> System.InvalidCastException:指定的强制转换无效。在 Microsoft.Data.Entity.Design.VersioningFacade.ReverseeEngineerDB.SchemaDiscovery.TableDetailsRow.get_IsPrimaryKey() ---内部异常堆栈跟踪结束---位于Microsoft.Data.Entity.Design.VersioningFacade.ReverseeEngineerDB.SchemaDiscovery.TableDetailsRow.get_IsPrimaryKey()处 在 Microsoft.Data.Entity.Design.VersioningFacade.ReverseeEngineerDB.StoreModelBuilder.CreateProperties(IList
1
列,IList
1错误,列表
1和键列,列表
1和排除列,
列表
1&invalidKeyTypeColumns)位于
Microsoft.Data.Entity.Design.VersioningFacade.ReverseeEngineerDB.StoreModelBuilder.CreateEntityType(IList
1 列、布尔值和需要定义查询)位于 Microsoft.Data.Entity.Design.VersioningFacade.ReverseeEngineerDB.StoreModelBuilder.CreateEntitySets(IEnumerable
1
tableDetailsRows,EntityRegister EntityRegister,IList
1 entitySetsForReadOnlyEntityTypes,DbObjectType objectType)位于 Microsoft.Data.Entity.Design.VersioningFacade.ReverseeEngineerDB.StoreModelBuilder.CreateEntitySets(IEnumerable
1
tableDetailsRowsForTables,IEnumerable
1 tableDetailsRowsForViews, EntityRegister EntityRegister)位于 Microsoft.Data.Entity.Design.VersioningFacade.ReverseeEngineerDB.StoreModelBuilder.Build(StoreSchemaDetails storeSchemaDetails)位于 Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.CreateStoreModel() 在 Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelGenerator.GenerateModel(列表
1
错误)在
Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModels(字符串
storeModelNamespace,ModelBuilderSettings设置,列表
1错误)
在 Microsoft.Data.Entity.Design.VisualStudio.ModelWizard.Engine.ModelBuilderEngine.GenerateModel(ModelBuilderSettings 设置、IVsUtils vsUtils、ModelBuilderEngineHostContext hostContext


看,我看这是一年后没有答案的。但万一有人来找我,我会把这个贴出来。