Application Can't Scaffold Items

Application can't scaffold items

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

base.OnModelCreating(modelBuilder);

Asp.Net Core MVC Movie App - Scaffolding Item not working properly

After going through the above suggestions, I still wasn't able to get the proper items to display for me. I then finally decided to uninstall Visual Studio 2017 and do a fresh install. I created my project, added the Entity Framework dependency, and now the proper items are displaying.

Scaffolding missing in dotnetcore 1.1 application VS2017

Newly created ASP.NET Core Project, Right-click on the Controllers folder in Solution Explorer and select Add > New Scaffolded Item.

This will ask for Add MVC Dependencies dialog. In this, select Minimal Dependencies, and select Add.

Sample Image

Visual Studio adds the dependencies needed to scaffold a controller, including a package with design-time EF functionality (Microsoft.EntityFrameworkCore.Design). A package that is needed only for scaffolding a DbContext from an existing database is also included (Microsoft.EntityFrameworkCore.SqlServer.Design).

After this, when you right click on the Controllers folder in Solution Explorer and select Add > New Scaffolded Item.

This will give you 'Add Scaffold' dialog box where you can select options like MVC controller with views, using Entity Framework

Sample Image

Hope this will help.



Related Topics



Leave a reply



Submit