Application can't scaffold items

asp.net-mvc, asp.net-mvc-scaffolding, c#, entity-framework-6, sql

Solution

I had this problem too, I solved the problem by calling the base.onModelCreating in my DB context

base.OnModelCreating(modelBuilder);

Problem

I created an MVC 5 application in VS 2013 Professional and then used EF 6.1 code first with an existing DB on SQL Server Express. When I try to create the views I’m using the “New scaffolded item…” then selecting the “MVC 5 controller with views, using Entity Framework.” I select the model and context classes and click OK. Then the following error message appears and no code is created. I’ve uninstalled EF Power Tools with the same error. Error There was an error running the selected code generator: ‘Exception has been thrown by the target of an invocation.’ I've also tried uninstalling/reinstalling VS 2013 and SQL Server with no changes. Any other ideas about what might cause this error?

Original source

Related problems