liveBook · Manning

Entry point

As explained in .NET MAUI in Action

An entry point is the method or platform-specific component at which an application begins execution.

An entry point is where an application begins execution. Regular C# programs usually start in a static Main method, while .NET MAUI starts through CreateMauiApp in MauiProgram.cs. section 2.3

A .NET MAUI startup flow proceeds through these components:

  • CreateMauiApp builds and returns a MauiApp with the generic host builder. section 2.3
  • UseMauiApp<App>() connects the host builder to the App application class. section 2.3
  • The App constructor assigns a Page, commonly MainPage, to the MainPage member. section 2.3
  • The platform-specific entry points for Android, iOS, and macOS initiate this regular execution flow. section 2.3

Startup flow

MauiProgram.CreateMauiApp() builds the application, UseMauiApp<App>() launches the App class, and App assigns new MainPage() to its MainPage member for display. section 2.3

Figure 2.13 In a .NET MAUI app, MauiProgram is the entry point, which launches App, which displays MainPage.

Trace the compact sequence from MauiProgram as the entry point to App and then the displayed MainPage. section 2.3

How .NET MAUI in Action covers it

How deep it goes
Distinguishes Main from CreateMauiApp and traces host construction, application creation, and initial page assignment.
Examples
Uses MauiProgram.cs, App.xaml.cs, CreateMauiApp, UseMauiApp<App>(), and new MainPage() as concrete artifacts.
What you can do after
Build it from scratch by configuring MauiProgram and assigning an initial Page through the App class.
How it connects
Connects CreateMauiApp with MauiApp, generic host builder, App, MainPage, Page, and platform-specific entry points.

Also explained in

Compare how 10 books explain entry point →

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.