FeaturedIT topics

Blazor now runs on a server: What you should know

It’s a year or so since Microsoft unveiled Blazor, its tool for running .Net code in the browser. It’s been an eventful year with several releases, each adding more and more code compatibility. Now described as “full-stack web development with C#,” Blazor runs on both clients and servers.

Built on top the open standard WebAssembly platform, Blazor implements a .Net runtime in the browser that’s optimized for single page web applications. With a browser version based on the familiar Mono, your code is compiled on the fly, driving HTML and JavaScript page components. While Microsoft still classifies Blazor as experimental, a series of recent announcements make it clear that it’s nearly ready for prime time.

Blazor on the server

While WebAssembly Blazor is still some distance from release, Microsoft is accelerating the release of the server-side version of the technology, as part of ASP.Net Core 3.0, under the name Razor Components. Don’t be fooled by the name change: This will be the familiar Blazor Razor syntax, with your code now running on a server, giving you the option of developing and using shared components across all your web applications.

Releasing a server-side version is a sensible decision, because not all browsers fully support WebAssembly. Instead of running in your browser, your Blazor code runs in ASP.Net Core, using SignalR to send events to and from JavaScript code in your browser.

It’s going to be a while before ASP.Net Core 3.0 gets released, but you can get started with server-side Blazor now to understand how to use it in your applications. You can also develop your first server-side Blazor components, using Razor syntax markup. The learning curve should be quite short, because there’s a lot of similarity between Blazor and the original ASP.Net approach to developing web apps, linking markup to code in the same document.

Related Articles

Back to top button