'System.StackOverflowException' 类型的异常在 ASP.NET MVC 中被抛出 OnModelCreating

Exception of type 'System.StackOverflowException' was thrown OnModelCreating in ASP.NET MVC

当我想 运行 我的项目时,我收到了 WhosebugException。我多次遇到此错误,但过了一会儿它就消失了,直到现在我根本无法 运行 我的项目才收到它。我不知道为什么 Visual studio 2019 不能 运行 我的项目并构建我的上下文。请注意,我有一个大型数据库,我通过“CodeFirst From Database”操作创建我的代码优先上下文。

This is image of Error

只需将您的方法分成几个 sub-methods 和 运行 您的项目。