Add MVC Controller with Views Using Entity Framework (2.0)

asp.net-mvc entity-framework entity-framework-core

Question

Controller will not create when adding a new MVC 5 controller with Views using Entity Framework.

The error message is:

Error Message

The Output window:

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.
1
4
4/13/2018 7:51:13 AM

Popular Answer

Rebuild your application and try again. If that doesn't work then your entity model is not working right. In my case my entity model was in another project folder hence i was unable to auto generate any of the controller. So i manually made a controller an empty controller and imported that project and model.

0
9/27/2018 11:58:40 AM


Related Questions





Related

Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow
Licensed under: CC-BY-SA with attribution
Not affiliated with Stack Overflow