How to Create .NET 4.8 MVC Database first MVC app and scaffold Controller
Many companies are still using .NET 4.x with MVC, in this article we will explore the basics of building an MVC 4.x Web app and use a database first approach to using Entity Framework. We will cover how to scaffold an MVC Controller and views.
Step 1: Create a new "Blank Solution"
Using visual studio select create a new Project then lookup and select "blank solution" template, I called mine Classic3, hit the create button.
Step2: Create a src folder
Right click on the Solution within visual studio and choose Add|New Solution folder, I always name mine "src".
Step3: Create an ASP.NET Web Application (.NET Framework)
Right click on the "src" folder and choose Add|New Project
In the new project dialog search for the template ASP.NET Web Application (.NET Framework), this has the potential to support web forms, MVC, Web API and many other features.
Click Next
In the "Configure your new Project" dialog, Set the Project name to something appropriate for example Microsite, or UI, the default is WebApplication1
Framework:
For this tutorial I chose .NET Framework 4.8.1
Click Create
In the "Create a new ASP.NET Web Application" dialog choose MVC, I left the Web API and Web forms checkboxes unchecked, set these to suit your additional requirements.
Click Create
Finally from the menu choose Build, to build the Project and then when it builds run the Project as a sanity check that everything so far is working.