使用Entity Framework添加带有视图的新MVC 5控制器时,Controller不会创建。
错误消息是:
“输出”窗口:
Finding the generator 'controller'...
Running the generator 'controller'...
Attempting to compile the application in memory.
Attempting to figure out the EntityFramework metadata for the model and DbContext: 'DayRateEmps'
info: Microsoft.AspNetCore.DataProtection.KeyManagement.XmlKeyManager[0]
User profile is available.
Using 'C:\Users\xxx.yyy\AppData\Local\ASP.NET\DataProtection-Keys' as key repository and Windows DPAPI to encrypt keys at rest.
Process is terminating due to StackOverflowException.
答案 0 :(得分:0)
重建您的应用程序,然后重试。如果这不起作用,则您的实体模型无法正常工作。在我的情况下,我的实体模型在另一个项目文件夹中,因此我无法自动生成任何控制器。因此,我手动将一个控制器设为空控制器,然后导入该项目和模型。