Blazor


Introduction

Blazor is an open source and cross-platform web UI framework for building single-page apps using .NET and C# instead of JavaScript. Blazor is based on a powerful and flexible component model for building rich interactive web UI. You implement Blazor UI components using a combination of .NET code and Razor syntax: an elegant melding of HTML and C#. Blazor components can seamlessly handle UI events, bind to user input, and efficiently render UI updates.

Blazor components can then be hosted in different ways to create your web app. The first supported way is called Blazor Server. In a Blazor Server app, the components run on the server using .NET Core. All UI interactions and updates are handled using a real-time WebSocket connection with the browser. Blazor Server apps are fast to load and simple to implement. Support for Blazor Server is available since .NET Core 3.1 LTS (2019-Oct-15).

Blazor WebAssembly is the second supported way since .NET Core 3.2 (2020-May-19) to host your Blazor components: client-side in the browser using a WebAssembly-based .NET runtime. Blazor WebAssembly includes a proper .NET runtime implemented in WebAssembly, a standardized bytecode for the web. This .NET runtime is downloaded with your Blazor WebAssembly app and enables running normal .NET code directly in the browser. No plugins or code transpilation are required. Blazor WebAssembly works with all modern web browsers, both desktop and mobile. Similar to JavaScript, Blazor WebAssembly apps run securely on the user’s device from within the browser’s security sandbox. These apps can be deployed as completely standalone static sites without any .NET server component at all, or they can be paired with ASP.NET Core to enable full stack web development with .NET, where code can be effortlessly shared with the client and server.

Blazor WebAssembly Features

  • Leverage the productivity of C# and strong runtime typing.
  • Build on the stable and mature .NET ecosystem.
  • Easily reuse code and existing .NET Standard libraries on the client and server.
  • Shared component model with Blazor Server apps.
  • Deploy your app as a standalone static site, or hosted with ASP.NET Core.
  • Build Progressive Web Apps (PWA) with offline capabilities and native OS integration.
  • Built-in support for authentication.
  • Integrated globalization & localization support.
  • Environment-based configuration.
  • IL trimming and build-time precompression.
  • Full stack debugging.
  • Great tooling with Visual Studio, Visual Studio for Mac, and Visual Studio Code.
  • Variety of Blazor UI components available from partners: Telerik | DevExpress | Syncfusion | Radzen | Infragistics | GrapeCity
  • Thriving free open-source community and ecosystem: Blazored | Blazorise | MatBlazor | BlazorStrap | Ant Design Blazor | bUnit | Blazor Extensions

Main Links

Other Links

PWA Publishing

Blazor Server App: Commands

  • To create a Blazor server app on a computer that has latest .NET framework run following commands in a command prompt:

    dotnet new blazorserver -o BlazorApp --no-https
    cd BlazorApp
    dotnet run
  • Now access the app in a browser using the address: http://localhost:5000

About Me
Hi, I'm Sameer. I love anything technology related and have chosen the field of Information Technology for my profession. I'm passionate about travel and never miss any chance to Read more...
Disclaimer
The views expressed on this website, be they in text, pictures or sound, are my own and not those of my business, university, employer or colleagues. Any points of Read more...