Advertisement
Beginner .NET MAUI, Fundamentals & Architecture

What is the 'single project' concept in MAUI?

Short answer

MAUI uses one .csproj that multi-targets several platforms. Platform-specific code, resources, and entry points live under a Platforms/ folder, while shared code, images, fonts, and app icons are declared once and processed per platform at build time.

Save .NET MAUI mock interview
Advertisement
AModel answer
MAUI uses one .csproj that multi-targets several platforms. Platform-specific code, resources, and entry points live under a Platforms/ folder, while shared code, images, fonts, and app icons are declared once and processed per platform at build time. This replaces the multiple head projects Xamarin required.
<TargetFrameworks>net8.0-android;net8.0-ios;net8.0-maccatalyst</TargetFrameworks>
<TargetFrameworks Condition="$([MSBuild]::IsOSPlatform('windows'))">
    $(TargetFrameworks);net8.0-windows10.0.19041.0
</TargetFrameworks>
Real-world example
One project outputs an .apk, an .ipa, and an .msix from the same source tree during CI.
Likely follow-ups
  • Where does platform-specific code go? | How does multi-targeting work?
Related topics