.NET MAUI Tutorial - Build your first multi-platform app in C#

Download and install

Download and install Visual Studio 2022.

Download Visual Studio 2022

During installation, the .NET Multi-platform App UI development workload should be selected. Using the link above should preselect all the prerequisites correctly, as shown on the following image:

Visual Studio Installer with the Mobile development with .NET workload selected

Already have Visual Studio 2022?

If you already have Visual Studio 2022, ensure it's up to date and has the required workload installed:

  • Select the Windows key, type Visual Studio Installer, and press Enter.
  • If prompted, allow the installer to update itself.
  • If an update for Visual Studio 2022 is available, an Update button will be shown. Select it to update before modifying the installation. This tutorial only works with Visual Studio 2022 17.12 and later versions.
  • Find your Visual Studio 2022 installation and select Modify.
  • Select .NET Multi-platform App UI development.
  • Select the Modify button.
  1. Download and install the .NET SDK. After the download completes, launch the download to begin the install.

    Download .NET 9 SDK x64 (Intel)
    Download .NET 9 SDK Arm64 (Apple Silicon)

    If you're on a Mac with an Apple M1 or M2 chip, you need to install the Arm64 version of the SDK.

  2. Download and install VS Code:

    Download VS Code

  3. Open VS Code and select the Extensions button in VS Code's Activity Bar to the left. Type MAUI in the search bar, select .NET MAUI, and then select the Install button on the .NET MAUI extension page.

    VS Code's MAUI Extension'

    This extension comes with the C# Dev Kit and the C# extensions, which are required for the .NET MAUI extension to run.

    VS Code's MAUI Extension Dependencies

  4. Open a new terminal and install the .NET MAUI workload by running the following command:

    Terminal
    sudo dotnet workload install maui

    If the installation succeeded, you should see an output similar to the following:

    Terminal
    Successfully installed workload maui

Check everything installed correctly

Once you've set up your environment, open a new VS Code terminal. In the toolbar, select Terminal, then New Terminal.

VS Code New Terminal

In your terminal, run the following command to check your installation.

Terminal
dotnet workload list

Run dotnet workload list command in VS Code Terminal

If the installation succeeded, you should see an output similar to the following:

Terminal
Installed Workload Id      Manifest Version      Installation Source
--------------------------------------------------------------------
maui                       8.0.82/8.0.100        SDK 8.0.400

Use `dotnet workload search` to find additional workloads to install.

Got an error?

If you receive a 'dotnet' is not recognized as an internal or external command error, make sure you opened a new VS Code terminal. If restarting VS Code or restarting your machine doesn't resolve the issue, use the I ran into an issue button at the bottom of the page to get help fixing the problem.

Install Xcode

To build .NET MAUI apps, you'll also need:

  1. Latest version of Xcode

    To find the latest version of Xcode that is compatible with .NET MAUI, check this release version reference. Go to the Apple Tools column to find the latest compatible Xcode version.

  2. An Apple ID

    If you don't already have an Apple ID, you can create a new one at https://appleid.apple.com. An Apple ID is required for installing and signing into Xcode.

  3. After installing Xcode, you must open Xcode and agree to the license agreements and install optional components, if prompted.

  4. When asked what platforms you'd like to develop for, select platforms macOS and iOS and then select Download & Install.

    Xcode's prompt to install macOS and iOS platforms

  5. Open a new terminal and install the Xcode command line developer tools by running the following command:

    Terminal
    xcode-select --install

    When prompted to install Xcode command line developer tools, select Install. Lastly, agree to the license agreement.

    Xcode's prompt to install command line developer tools

If everything looks good, select the Continue button below to go to the next step.

Continue