aspnetcore/tutorials/first-mvc-app/start-mvc.md
:::moniker range=">= aspnetcore-10.0"
[!INCLUDE consider RP]
This is the first tutorial of a series that teaches ASP.NET Core MVC web development with controllers and views.
At the end of the series, you'll have an app that manages, validates, and displays movie data. You learn how to:
[!div class="checklist"]
- Create a web app.
- Add and scaffold a model.
- Work with a database.
- Add search and validation.
View or download sample code (how to download).
MvcMovie for Project name. It's important to name the project MvcMovie. Capitalization needs to match each namespace when code is copied.:::image type="content" source="~/tutorials/first-mvc-app/start-mvc/media/net10-additional-info.png" alt-text="Additional info dialog.":::
For more information, including alternative approaches to create the project, see Create a new project in Visual Studio.
Visual Studio uses the default project template for the created MVC project. The created project:
The tutorial assumes familiarity with VS Code. For more information, see Getting started with VS Code and Visual Studio Code help.
Select New Terminal from the Terminal menu to open the integrated terminal.
Change to the directory (cd) that will contain the project. The project can be located anywhere.
Run the following commands:
dotnet new mvc -o MvcMovie
code -r MvcMovie
The dotnet new command creates a new ASP.NET Core MVC project in the MvcMovie folder.
The code command opens the MvcMovie project folder in the current instance of Visual Studio Code.
Visual Studio runs the app and opens the default browser.
The address bar shows localhost:<port#> and not something like example.com. The standard hostname for your local computer is localhost. When Visual Studio creates a web project, a random port is used for the web server.
Launching the app without debugging by pressing <kbd>Ctrl</kbd>+<kbd>F5</kbd> allows you to:
You can launch the app in debug or non-debug mode from the Debug menu:
:::image type="content" source="~/tutorials/first-mvc-app/start-mvc/media/debug-menu.png" alt-text="Start Debug and Start Without Debugging menus.":::
You can debug the app by selecting the https button in the toolbar:
:::image type="content" source="~/tutorials/first-mvc-app/start-mvc/media/debug-button.png" alt-text="MvcMovie debug button.":::
The following image shows the app:
:::image type="content" source="~/tutorials/first-mvc-app/start-mvc/media/mvc-movie-home-page.png" alt-text="Home or Index page.":::
In Visual Studio Code, press <kbd>Ctrl</kbd>+<kbd>F5</kbd> (Windows)/<kbd>^</kbd>+<kbd>F5</kbd> (macOS) to run the app without debugging.
Visual Studio Code:
https://localhost:<port#>.The address bar shows localhost:<port#> and not something like example.com. The standard hostname for your local computer is localhost. Localhost only serves web requests from the local computer.
Launching the app without debugging by selecting Ctrl+F5 allows you to:
Make code changes.
Save the file.
Quickly refresh the browser and see the code changes.
:::image type="content" source="~/tutorials/first-mvc-app/start-mvc//media/mvc-movie-home-page.png" alt-text="Home or Index page.":::
Close the browser window.
In Visual Studio Code, from the Run menu, select Stop Debugging or press <kbd>Shift</kbd>+<kbd>F5</kbd> to stop the app.
In the next tutorial in this series, you learn about MVC and start writing some code.
[!div class="step-by-step"] Next: Add a controller
:::moniker-end