Добавил:
Опубликованный материал нарушает ваши авторские права? Сообщите нам.
Вуз: Предмет: Файл:
vermeir_nico_introducing_net_6_getting_started_with_blazor_m.pdf
Скачиваний:
19
Добавлен:
26.06.2023
Размер:
11.64 Mб
Скачать

CHAPTER 2

Runtimes and Desktop

Packs

.NET 6 runs everywhere, from Windows to the Web, Linux, and mobile and embedded devices. But how? How do they manage to get the same code to run and behave in (mostly) the same way not only across platforms but also across CPU architectures? The secret is in the underlying architecture of .NET 6.

There have been numerous iterations in Microsoft’s cross-platform strategy. We’ve seen shared projects in Xamarin, where the code gets compiled into each platform; we have had portable class libraries where the libraries supported the lowest common denominator of all the selected platforms and more recently we had .NET Standard libraries. But why all these different approaches? It’s actually quite simple. .NET on one

platform was not exactly the same as .NET on another platform. We’ve had .NET, Mono,

.NET Compact Framework, .NET Micro Framework, etc.

Fixing the splintering of .NET versions was one of the core promises of .NET Core; it took a bit longer than expected but we are finally getting really close to one .NET. No matter what platform you are running on, if your application is running on .NET 6, you can use .NET 6 class libraries and share them over all supported platforms.

.NET 6 Architecture

A very big step on the road to .NET unification was taken in .NET 5, by closing a big gap in missing APIs compared to the classic .NET Framework Microsoft that was able to serve the .NET API surface as an abstraction layer. This means that, as developers, we don’t have to worry about what platform we’re running on or if certain .NET features will work or even compile on the platform we’re running on. Figure 2-1 shows Microsoft’s view on .NET architecture.

21

© Nico Vermeir 2022

N. Vermeir, Introducing .NET 6, https://doi.org/10.1007/978-1-4842-7319-7_2