Home » New in .NET 8.0 [2]: New types of applications

New in .NET 8.0 [2]: New types of applications

by admin
New in .NET 8.0 [2]: New types of applications

New in .NET 8.0 [2]: New types of applications

.NET 8.0 – just like the previous version – includes numerous types of applications based on a common software development kit (SDK), a common base class library, the languages ​​C#, F# and Visual Basic .NET as well as the object-relational mapper that can be used in (almost) all types of applications Entity Framework Core (see Figure 1).

Advertisement

Dr. Holger Schwichtenberg is Chief Technology Expert at MAXIMAGO, which offers innovation and experience-driven software development, including in highly critical safety-related areas. He is also head of the expert network www.IT-Visions.de, which supports numerous medium-sized and large companies with advice and training in the development and operation of software with 43 renowned experts.

Two different runtimes continue to work underground, depending on the type of application and operating system: the .NET Core Runtime and the Mono Runtime.

New in .NET 8.0 in terms of application types are the following variants of Blazor:

Blazor-Auto-Rendering-ModusBlazor Static-Server-Rendering (Blazor SSR)

.NET 8.0 offers numerous application types on a common basis.

(Image: Holger Schwichtenberg)

Before .NET 8.0, single-page web application developers were spoiled for choice between Blazor Server and Blazor WebAssembly, which in some practical cases felt like a choice between plague and cholera due to the advantages and disadvantages of both architectures. You could help yourself by offering a web application in both architectures for different user groups or locations.

.NET 8.0 now allows both architectures to be combined in a single web application. The new “Auto” rendering mode renders a web application in three stages (see Figure 2): First, pre-rendering takes place with Blazor SSR on the web server. The page is then hydrated via JavaScript and Blazor Server with interactivity via a websocket connection. After the extensive files for Blazor WebAssembly have been reloaded in the background, the web application finally switches to purely local rendering in the browser and terminates the websocket connection. It is possible that Blazor will bypass the first hydration and switch directly from Blazor SSR pre-rendering to Blazor WebAssembly if Blazor detects that Blazor WebAssembly can load fast enough (100 milliseconds according to the developer blog at Microsoft). During the preview phase of .NET 8.0, Microsoft called this automation “Blazor United”.

See also  Women Plus arrives, Tim's app for women...

Hydrogenation in Blazor auto-rendering mode (Fig. 2)

(Image: Holger Schwichtenberg)

Blazor Static Server Rendering (Blazor SSR) is a variant of Blazor in which the Razor components render purely on the web server; In contrast to the Blazor single-page web applications, Blazor SSR creates a multi-page application (see Figure 3). Blazor SSR can be considered a better alternative to ASP.NET Core Model View Controller (MVC) and ASP.NET Razor Pages because Blazor SSR includes a true component model, better Razor syntax, and in some situations enhanced navigation and streaming). For enhanced navigation and streaming, Blazor SSR requires the included JavaScript library blazor.web.js. If these features are omitted, Blazor SSR also runs without JavaScript.

Microsoft called this architectural model “Blazor Server-Side Rendering” (SSR) in the preview phase, but in the final version it decided to let SSR stand for “Static Server Rendering” – with the aim of creating a clearer distinction to create Blazor Server. However, the new choice of words is also likely to cause confusion because some web frameworks offer rendering at development time under the term “Static Site Generation”. Blazor SSR does not render at development time, but at runtime. Microsoft is only planning static site generation for .NET 9.0. As a preliminary stage, it is already possible in .NET 8.0 to render Razor components in any type of application. This means that the same syntax used in Blazor for web and hybrid applications is now also available for HTML rendering for HTML emails or other HTML applications (see new class Microsoft.AspNetCore.Components.Web .HtmlRenderer).

See also  Prison Architect 2 delayed again to September

Blazor-based web applications compared to ASP.NET Core MVC and ASP.NET Core Razor Pages (Fig. 3)

(Image: Holger Schwichtenberg)

Projects with Blazor SSR and the auto-render mode are started in Visual Studio with the new project template “Blazor Web App” (see Figure 4). Use on the command line

dotnet new blazor –interactivity none

and

dotnet new blazor –interactivity none

Blazor SSR and auto-render mode along with Blazor Server and Blazor WebAssembly in the Blazor Web App project template (Fig. 4)

(Bild: Screenshot / Holger Schwichtenberg)

(rme)

To home page

You may also like

Leave a Comment

This site uses Akismet to reduce spam. Learn how your comment data is processed.

This website uses cookies to improve your experience. We'll assume you're ok with this, but you can opt-out if you wish. Accept Read More

Privacy & Cookies Policy