Look sharp: Microsoft Blazor's gone mobile. Fancy developing mobile apps with C# web technology?

Going like Blazor(s) everywhere, says Microsoft, but will this enthusiasm last?

Microsoft will provide experimental support for native mobile applications using its Blazor web development platform.

Redmond describes Blazor as a framework that "lets you build interactive web UIs using C# instead of JavaScript." Blazor began in 2017 as an experiment in hosting the .NET runtime in the browser by compiling it to WebAssembly. The name is a reference to Razor, which is the syntax used in ASP.NET to combine HTML with C# code to create a dynamic web page. Blazor allowed that C# code to execute in the browser instead of on the server.

The concept has evolved substantially. In 2018 Microsoft made Blazor officially part of ASP.NET Core, its open source web application platform. Blazor was also extended to include Blazor Server, where the .NET code runs on the server and communicates with the UI in the browser via SignalR real-time messaging. The outcome for the developer is the same: a user interface developed using C# rather than JavaScript.

At an online .NET Conf yesterday, focused on Blazor, Microsoft elaborated on further plans for the framework. Blazor Hybrid is an experiment in hosting Razor components inside Electron, to create desktop applications. There is also a project to create desktop Blazor or .NET Core applications using WebWindow, which avoids having to bundle any browser components by using what is native to the operating system (Chromium-Edge on Windows, WebKit on Mac, WebKitGTK+ 2 on Linux). This results in a much smaller application size.

Perhaps the biggest Blazor news, though, is the announcement of experimental Mobile Blazor. Microsoft's Eilon Lipton, principal software engineer, explains that Mobile Blazor Bindings "enable developers to build native mobile apps using C# and .NET for iOS and Android using familiar web programming patterns." The actual UI components are based on Xamarin Forms, but instead of using the Xamarin flavour of XAML to define the UI, it uses Razor syntax.

Code for Mobile Blazor is available today but is described as an "experimental project", so there is no guarantee that it will ever reach general availability. Lipton said the reason for the project is that: "We have heard from a set of developers that come from a web programming background that having web specific patterns to build mobile applications would be ideal for them."

Note that although Lipton refers to "web programming patterns", this is distinct from technology like Apache Cordova that uses web browser components. Blazor Mobile Bindings uses native iOS and Android UI elements.

As of now, the only part of Blazor that is said to be production-ready is Blazor Server. Blazor WebAssembly will be complete in May 2020, but only with interpreted .NET. Ahead of Time (AOT) compilation is promised for .NET 5.0, expected in November 2020. The overall schedule for .NET releases is to have a major update in November ever year, but with only the even numbered releases designated as LTS (Long Term Support). The last LTS release was .NET Core 3.1 in November 2019, and the next is .NET 6.0 in November 2021.

Blazor everwhere: Microsoft's ambitious plans for its C# web platform

Blazor everywhere: Microsoft's ambitious plans for its C# web platform

If all Microsoft's Blazor plans come to fruition, though, there will be a Blazor variant for everything from web applications to desktop and mobile.

If you have nine hours to spare and want to learn more about Blazor, the entire conference is available online here, with the mobile efforts described around five hours in.

Taken in isolation, Blazor looks promising as a way for .NET developers to extend their reach. Microsoft's problem, however, is that it had an abundance of developer technologies and a history of false starts (Silverlight anyone?). At the Ignite event last November, we heard the Windows and Office teams enthuse about React Native, for example, for cross-platform development. What about UWP? Xamarin Forms? It is not easy for developers to know which of Microsoft's developer technologies has the best long-term future, though you can at least say that the company has worked hard to keep the C# language as an option across many different platforms. ®

Biting the hand that feeds IT © 1998–2021