Getting Started With Setting Up Blazor In Visual Studio

Introduction

 
Blazor is a web UI framework based on C# and Razor that runs in the Web browser. Using Blazor you can build a rich interactive UI using C#.

Blazor greatly simplifies the task of building fast and beautiful single-page applications that run in any browser. It does this by enabling developers to write .NET-based web apps that run client-side in web browsers using open web standards.

Features & Functionality

  • Routing
  • A component model for building composable UI
  • Layouts
  • Forms and validation
  • Dependency injection
  • JavaScript interop
  • Live reloading in the browser during development
  • Server-side rendering
  • Full .NET debugging both in browsers and in the IDE
  • Rich IntelliSense and tooling
  • Publishing and app size trimming

Blazor optionally integrates with ASP.NET Core to provide a seamless and consistent full-stack web development solution.

Blazor WebAssembly has achieved cross-browser consensus and all modern browsers now support WebAssembly.

Step 1

Install the latest Blazor extension from the Visual Studio Marketplace. This step makes Blazor templates available to Visual Studio.
 
Setup Blazor in Visual Studio
 
After installing Blazor Extension Make sure you have installed following listed :
  1. .NET Core 3.0 Preview 4 SDK (3.0.100-preview4-011223)
  2. Visual Studio 2019 (Preview 4 or later) with the ASP.NET and web development workload selected.
  3. The latest Blazor extension from the Visual Studio Marketplace.
  4. The Blazor templates on the command-line:

dotnet new -i Microsoft.AspNetCore.Blazor.Templates::3.0.0-preview4-19216-03

Step 2

Create a new project & select ASP.NET Core Web Application.

Step 3

Decide on which template you want to use Blazor  -- Server Side or Client Side -- and create.

After creating it, just run it in your browser and see what happens. 

See Also