liveBook · Manning

Common Language Runtime

As explained in .NET MAUI in Action

The Common Language Runtime is the .NET execution environment that manages and runs compiled managed code.

The Common Language Runtime (CLR) is the execution environment for .NET applications. In .NET MAUI, a platform-specific runtime executes the app on Android, iOS, macOS, or Windows, allowing shared application logic to run across targets. section 1.2

The runtime fits into the .NET MAUI stack as follows:

  • The target operating system supplies the underlying platform APIs. section 1.2
  • Mono provides the runtime for Android, iOS, and macOS, while WinRT provides it for Windows. section 1.2
  • The .NET Base Class Library sits above the runtime and supplies shared features such as lists and generics. section 1.2
  • A .NET build produces CLR code containing a directory of classes, public members, and resources. section 2.4.1

Why Hot Reload sometimes rebuilds

Hot Reload can change code inside an existing method or update supported XAML changes while the app runs. It must rebuild when a change adds or removes a class, method, or resource because the compiled directory cannot be altered at runtime. section 2.4.1

Figure 1.2 .NET MAUI is built bottom-up. Each platform provides APIs, and there is a .NET runtime for each platform (WinRT on Windows, Mono on everything else) built on these APIs. Each layer provides APIs used to build the APIs in the layer above. Meanwhile, your code is written top-down: you write a .NET MAUI app, and the architecture encapsulates it for lower layers.

Follow the layered architecture from operating-system APIs through the platform runtime, BCL, and .NET MAUI to application code. section 1.2

How .NET MAUI in Action covers it

How deep it goes
Explains platform placement and compiled CLR-code limits, but stops short of runtime implementation internals.
Examples
Uses a layered .NET MAUI architecture and Hot Reload changes to methods, XAML, classes, methods, and resources.
What you can do after
Diagnose why Hot Reload accepts some changes immediately but requires rebuilding for structural changes.
How it connects
Connects the runtime with .NET MAUI, the .NET BCL, platform APIs, target operating systems, and Hot Reload.

Also explained in

Compare how 3 books explain Common Language Runtime →

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.