Lab 1.4 - Get Started With ASP - Net Core and Visual Studio (Create MVC Project)
Lab 1.4 - Get Started With ASP - Net Core and Visual Studio (Create MVC Project)
Lab 1.4 – Get started with ASP.NET Core and Visual Studio
Estimated usage time: 30 minutes
This tutorial teaches ASP.NET Core MVC web development with controllers and views. If you're new to
ASP.NET Core web development, consider the Razor Pages version of this tutorial, which provides an
easier starting point. This is the first tutorial of a series that teaches ASP.NET Core MVC web development
with controllers and views.
Prerequisites
• Visual Studio 2022 or above with the following workloads:
o ASP.NET and web development
o .NET Core cross-platform development
• .NET 6.0 SDK or later.
• Tap Next
• Name the project as "MVC_APU_FlowerShop2023" (It's important to name the project "
MVC_APU_FlowerShop2023" so when you copy code, the namespace will match.)
• Tap Next
• In the Target Framework selector drop-down box select .NET 7.0 (Standard Term Support)
• In the Authentication Type selector drop-down box select None
• Check the Configure for HTTPS
• Uncheck the Enable Docker
NOTE:
Visual Studio used a default template for the MVC project you just created. You have a working app
right now by entering a project name and selecting a few options. This is a basic starter project, and
it's a good place to start.
The default template gives you working Home and Privacy links. The browser image above doesn't
show these links. Depending on the size of your browser, you might need to click the navigation icon
to show them.
==================================================================================
Notes:
• Visual Studio starts IIS Express and runs your app. Notice that the address bar
shows localhost:port# and not something like example.com. That's because localhost is the standard
hostname for your local computer. When Visual Studio creates a web project, a random port is used
for the web server. In the image above, the port number is 5000. The URL in the browser
shows localhost:5000. When you run the app, you'll see a different port number.
• Launching the app with Ctrl+F5 (non-debug mode) allows you to make code changes, save the file,
refresh the browser, and see the code changes. Many developers prefer to use non-debug mode to
quickly launch the app and view changes.
• You can launch the app in debug or non-debug mode from the Debug menu item:
Summary:
• We have learnt how to create a simple ASP .Net Core Web Application in Visual Studio.