aspnetcore/tutorials/razor-pages/razor-pages-start/includes/razor-pages-start3.md
:::moniker range="< aspnetcore-5.0"
This is the first tutorial of a series that teaches the basics of building an ASP.NET Core Razor Pages web app.
For a more advanced introduction aimed at developers who are familiar with controllers and views, see Introduction to Razor Pages.
At the end of the series, you'll have an app that manages a database of movies.
View or download sample code (how to download).
In this tutorial, you:
[!div class="checklist"]
- Create a Razor Pages web app.
- Run the app.
- Examine the project files.
At the end of this tutorial, you'll have a working Razor Pages web app that you'll build on in later tutorials.
From the Visual Studio File menu, select New > Project.
Create a new ASP.NET Core Web Application and select Next.
Name the project RazorPagesMovie. It's important to name the project RazorPagesMovie so the namespaces will match when you copy and paste code.
Select ASP.NET Core 3.1 in the dropdown, Web Application, and then select Create.
The following starter project is created:
Open the integrated terminal.
Change to the directory (cd) which will contain the project.
Run the following commands:
dotnet new webapp -o RazorPagesMovie
code -r RazorPagesMovie
dotnet new command creates a new Razor Pages project in the RazorPagesMovie folder.code command opens the RazorPagesMovie folder in the current instance of Visual Studio Code.After the status bar's OmniSharp flame icon turns green, a dialog asks Required assets to build and debug are missing from 'RazorPagesMovie'. Add them? Select Yes.
A .vscode directory, containing launch.json and tasks.json files, is added to the project's root directory.
If Visual Studio Code doesn't offer to add the assets automatically, see the Linux operating system guidance in xref:blazor/tooling?pivot=linux.
Select File > New Solution.
In Visual Studio for Mac earlier than version 8.6, select .NET Core > App > Web Application > Next. In version 8.6 or later, select Web and Console > App > Web Application > Next.
In the Configure the new Web Application dialog:
Select Next.
Name the project RazorPagesMovie, and then select Create.
Here's an overview of the main project folders and files that you'll work with in later tutorials.
Contains Razor pages and supporting files. Each Razor page is a pair of files:
.cshtml file that has HTML markup with C# code using Razor syntax..cshtml.cs file that has C# code that handles page events.Supporting files have names that begin with an underscore. For example, the _Layout.cshtml file configures UI elements common to all pages. This file sets up the navigation menu at the top of the page and the copyright notice at the bottom of the page. For more information, see xref:mvc/views/layout.
Contains static files, like HTML files, JavaScript files, and CSS files. For more information, see xref:fundamentals/static-files.
appSettings.jsonContains configuration data, like connection strings. For more information, see xref:fundamentals/configuration/index.
Contains the entry point for the program. For more information, see xref:fundamentals/host/generic-host.
Contains code that configures app behavior. For more information, see xref:fundamentals/startup.
[!div class="step-by-step"] Next: Add a model
:::moniker-end