Create ASP.NET MVC Application
In this section, we will create a new MVC web application using Visual Studio and understand the basic building blocks of the ASP.NET MVC Application.
We are going to use ASP.NET MVC v5.2, and Visual Studio 2017 community edition, and .NET Framework 4.6 to create our first MVC application.
Download the latest version of Visual Studio from visualstudio.microsoft.com/downloads.
Open Visual Studio 2017 and select File menu -> New -> Project, as shown below.
From the New Project dialog as shown below, expand Visual C# node and select Web in the left pane, and then select ASP.NET Web Application (.NET Framework) in the middle pane.
Enter the name of your project MyMVCApplication
. (You can give an appropriate name for your application). Also, you can change the location of the MVC application by clicking on Browse.. button. Finally, click OK.
From the New ASP.NET Web Application dialog, select MVC (if not selected already) as shown below.
You can also change the authentication by clicking on Change Authentication button. You can select appropriate authentication mode for your application, as shown below.
Here, we are keeping the default authentication for our application which is No Authentication. Click OK to continue.
Wait for some time till Visual Studio creates a simple MVC project using the default template, as shown below.
Now, press F5 to run the project in debug mode or Ctrl + F5 to run the project without debugging. It will open the home page in the browser, as shown below.
MVC 5 project includes JavaScript and CSS files of bootstrap 3.0 by default. So you can create responsive web pages. This responsive UI will change its look and feel based on the screen size of the different devices. For example, the top menu bar will be changed in the mobile devices, as shown below.
In this way, you can create your ASP.NET MVC 5 application using Visual Studio 2017.
Learn about ASP.NET MVC project's folder structure in the next section.