使用 Add-Migration InitialCreate 生成数据库报错
- 错误明细
System.MissingMethodException : Method not found: 'System.Collections.Generic.IList`1<Microsoft.EntityFrameworkCore.Metadata.Conventions.IModelFinalizingConvention> Microsoft.EntityFrameworkCore.Metadata.Conventions.ConventionSet.get_ModelFinalizingConventions()'.
Stack Trace:
at Microsoft.EntityFrameworkCore.InMemory.Metadata.Conventions.InMemoryConventionSetBuilder.CreateConventionSet()
解决
-
把 microsoft.entityframeworkcore.tools 、microsoft.entityframeworkcore.design
、microsoft.entityframeworkcore 升级到 6 就可以了(之前是7.0.x)
QQ截图20230503203927.png
网友评论