Setting Up .NET MAUI Development Environment

Beginner 20 min read Lesson 2 of 8

System Requirements

Windows
  • Windows 10/11 (version 1903+)
  • Visual Studio 2022 (17.3+)
  • Android SDK
  • 16GB RAM recommended
macOS
  • macOS 11.0 (Big Sur)+
  • Visual Studio for Mac
  • Xcode 13+
  • Android SDK
Linux
  • Ubuntu 20.04+
  • Visual Studio Code
  • .NET SDK 10
  • Android SDK

Installation Steps

Step 1: Install Visual Studio 2022

1Download Visual Studio

Visit visualstudio.microsoft.com

Download Visual Studio 2022 Community (free) or Professional/Enterprise

2Select Workloads

During installation, select these workloads:

  • .NET MAUI App Development (Main workload)
  • Mobile development with .NET (Includes Android and iOS)
  • Universal Windows Platform development (For Windows apps)
3Install Optional Components
  • Android SDK and NDK
  • iOS SDK (requires Mac)
  • Windows SDK

Step 2: Install .NET MAUI Workload

// Check if MAUI is installed
dotnet workload list

// Install MAUI workload
dotnet workload install maui

// Install Android workload
dotnet workload install android

// Install iOS workload (requires Mac)
dotnet workload install ios

// Install macOS workload
dotnet workload install macos

// Install Windows workload
dotnet workload install wasm-tools

Step 3: Configure Android Development

// Install Android SDK
// Via Visual Studio: Tools > Android > Android SDK Manager

// Accept licenses
dotnet android accept

// Set Android SDK path
// Environment Variable: ANDROID_SDK_ROOT
// Path: C:\Users\[User]\AppData\Local\Android\Sdk

// Create Android emulator
// Tools > Android > Android Device Manager
// Create new device with appropriate API level

Step 4: Configure iOS Development (macOS only)

// Install Xcode from Mac App Store
// Install Xcode Command Line Tools
xcode-select --install

// Open Xcode and accept license agreements
// Install iOS simulator

Step 5: Verify Installation

// Create test project
dotnet new maui -n TestApp
cd TestApp

// Build project
dotnet build

// Run on Android (requires emulator or device)
dotnet build -t:Run -f net10.0-android

// Run on Windows
dotnet build -t:Run -f net10.0-windows10.0.19041.0

// Run on macOS
dotnet build -t:Run -f net10.0-maccatalyst

Troubleshooting Common Issues

  • Set ANDROID_SDK_ROOT environment variable
  • Install Android SDK via Visual Studio
  • Check path in Tools > Options > Xamarin > Android

  • Enable Hyper-V in Windows Features
  • Enable Hardware Virtualization in BIOS
  • Check Android SDK Manager for missing components

  • iOS development requires a Mac
  • Use remote build agent with Hot Restart
  • Connect to Mac via Visual Studio

Development Tools

  • Visual Studio 2022 - Primary IDE with MAUI support
  • Visual Studio Code - Lightweight alternative with MAUI extension
  • Android Studio - For Android emulator management
  • Xcode - Required for iOS development (macOS)
  • Postman - For API testing
  • Git - Version control
Key Takeaway

Setting up .NET MAUI development requires installing the right workloads and SDKs. The process is straightforward with the right tools and configuration.

Exercise

Set up your MAUI development environment:

  1. Install Visual Studio 2022 with MAUI workload
  2. Install Android SDK and create an emulator
  3. Install .NET MAUI workload
  4. Create and run a test MAUI project
  5. Verify all platforms work
Test Your Knowledge - Take Quiz