Cette page est affichée en anglais. Une traduction française est en cours.
ConfigsMay 16, 2026·3 min de lecture

.NET MAUI — Build Native Cross-Platform Apps with C# and XAML

Create native mobile and desktop applications for Android, iOS, macOS, and Windows from a single C# and XAML codebase. .NET MAUI is the evolution of Xamarin.Forms, providing a unified framework for multi-platform development.

Prêt pour agents

Cet actif peut être lu et installé directement par les agents

TokRepo expose une commande CLI universelle, un contrat d'installation, le metadata JSON, un plan selon l'adaptateur et le contenu raw pour aider les agents à juger l'adaptation, le risque et les prochaines actions.

Native · 98/100Policy : autoriser
Surface agent
Tout agent MCP/CLI
Type
Skill
Installation
Single
Confiance
Confiance : Established
Point d'entrée
.NET MAUI Overview
Commande CLI universelle
npx tokrepo install 01e879c4-5143-11f1-9bc6-00163e2b0d79

Introduction

.NET Multi-platform App UI (MAUI) is Microsoft's framework for building native cross-platform applications with C# and XAML. It unifies Android, iOS, macOS, and Windows development into a single project structure, replacing Xamarin.Forms with a modernized architecture built on .NET 6+.

What .NET MAUI Does

  • Enables single-project development targeting Android, iOS, macOS, and Windows
  • Provides native UI controls that map to platform-specific widgets
  • Offers hot reload for both XAML and C# during development
  • Includes a dependency injection container and app lifecycle management
  • Supports Blazor Hybrid for embedding web UI within native app shells

Architecture Overview

MAUI uses a handler architecture where each cross-platform control maps to a platform-specific native control through handler classes. The framework runs on .NET runtime with platform-specific workloads (Android uses Mono, iOS uses AOT compilation, Windows uses WinUI 3, macOS uses Mac Catalyst). A single .csproj file manages all platform targets with conditional compilation and platform-specific resource management.

Self-Hosting & Configuration

  • Install the .NET SDK with MAUI workload via dotnet workload install maui
  • Configure target frameworks in the .csproj file (net8.0-android, net8.0-ios, etc.)
  • Manage app identity and permissions in Platforms/ folder per target
  • Set up resources (fonts, images, splash screens) in the shared Resources/ directory
  • Use MauiProgram.cs to configure services, fonts, and platform-specific handlers

Key Features

  • Single project structure eliminates the need for separate platform projects
  • Blazor Hybrid support lets you reuse web components inside native apps
  • Native performance with platform-specific rendering (no WebView overhead)
  • Extensive community ecosystem of controls and libraries via NuGet
  • Visual Studio integration with designers, profilers, and device emulators

Comparison with Similar Tools

  • Xamarin.Forms — predecessor to MAUI; MAUI modernizes the architecture with handlers and single-project structure
  • Flutter — uses Dart with custom rendering; MAUI uses C# with native platform controls
  • React Native — JavaScript with native views; MAUI targets developers already in the .NET ecosystem
  • Uno Platform — also targets multiple platforms with C#/XAML but renders via SkiaSharp; MAUI uses native controls
  • Avalonia UI — cross-platform .NET UI with custom rendering; MAUI provides native look and feel per platform

FAQ

Q: Is .NET MAUI the replacement for Xamarin? A: Yes. Microsoft officially transitioned from Xamarin.Forms to .NET MAUI. Xamarin support ended in May 2024 and MAUI is the recommended migration path.

Q: Can I use .NET MAUI on Linux? A: Linux is not officially supported as a deployment target. Community efforts exist but Microsoft focuses on Android, iOS, macOS, and Windows.

Q: Does MAUI support hot reload? A: Yes. Both XAML Hot Reload and .NET Hot Reload are supported, allowing you to see UI and logic changes without restarting the app during debugging.

Q: Can I mix Blazor web components with native MAUI views? A: Yes. Blazor Hybrid lets you host Razor components inside a BlazorWebView control within your MAUI app, combining web and native UI in one application.

Sources

Fil de discussion

Connectez-vous pour rejoindre la discussion.
Aucun commentaire pour l'instant. Soyez le premier à partager votre avis.

Actifs similaires