First you need to create an ASP.NET project with Visual Studio 2022 (Create your first ASP.NET project with Visual Studio 2022)
Create a Shared folder to store the Layout of the website
Right-click the Views folder, select Add, and select New Folder
Right-click on the Shared folder, select Add, and select New Item
Select the item MVC 5 Layout Page (Razor)
Filename: _WebApp.cshtml (Does not overlap with another ASP.NET project)
Click the Add button
In the Controllers folder create the file HomeController.cs
Right-click the Controllers folder, select Add, select Controller...
In the Add New Scaffolded Item window
Select the item MVC 5 Controller - Empty
Click the Add button
Controller name: HomeController
After creating HomeController.cs
Find the word Index, right-click on Index, select Add View...
In the Add New Scaffolded Item window
Select the item MVC 5 View
Click the Add button
In the Add View window
Click on the ... icon
In the Select a Layout Page window
Navigate to the Shared folder, select [@]_WebApp.cshtml
Click the OK button
In the Add View window
Click the Add button
Build solution
On the menu of Visual Studio 2022 select Build, select Build Solution
Or press the key combination Ctrl + Shift + B
Right click on a folder (any), select View in Browser (Google Chrome)
Or simply press F5
If you do all the above steps correctly, the browser will display the following: