Skip to content

Latest commit

 

History

History
51 lines (33 loc) · 2.36 KB

00-get-started.md

File metadata and controls

51 lines (33 loc) · 2.36 KB

Get started

In this session, you'll setup your machine for Blazor development and build your first Blazor app.

Setup

Install the following:

  1. .NET Core 2.1 SDK (2.1.500 or later).

  2. Visual Studio 2017 (15.9 or later) with the ASP.NET and web development workload selected.

  3. The latest Blazor Language Services extension from the Visual Studio Marketplace.

  4. The Blazor templates on the command-line:

    dotnet new -i Microsoft.AspNetCore.Blazor.Templates

Build and run your first Blazor app

To create a Blazor project in Visual Studio:

  1. Select File > New > Project. Select Web > ASP.NET Core Web Application. Name the project "BlazorApp1" in the Name field. Select OK.

    New ASP.NET Core project

  2. The New ASP.NET Core Web Application dialog appears. Make sure .NET Core is selected at the top. Also select ASP.NET Core 2.1. Choose the Blazor template and select OK.

    New Blazor app dialog

  3. Once the project is created, press Ctrl-F5 to run the app without the debugger. Running with the debugger (F5) isn't supported at this time.

Note

If not using Visual Studio, create the Blazor app at a command prompt on Windows, macOS, or Linux:

dotnet new blazor -o BlazorApp1
cd BlazorApp1
dotnet run

Navigate to the app using the localhost address and port provided in the console window output after dotnet run is executed. Use Ctrl-C in the console window to shutdown the app.

The Blazor app runs in the browser:

Blazor app Home page

Congrats! You just built and ran your first Blazor app!

If you have more time, try out the rest of the introductory Blazor tutorial

Next up - Components and layout