Getting Started with .NET MAUI: Setup

This guide will walk you through the process of setting up your development environment to start building cross-platform applications with .NET MAUI.

Prerequisites

Before you begin, ensure you have the following installed:

For specific OS requirements, please refer to the official .NET MAUI documentation.

Installing .NET MAUI Workload

Once .NET SDK is installed, you need to install the .NET MAUI workload. Open your command-line interface (Command Prompt, PowerShell, or Terminal) and run the following command:

dotnet workload install maui

This command downloads and installs all the necessary components for developing .NET MAUI applications, including platform-specific SDKs.

This step might take a few minutes depending on your internet connection.

Setting up Visual Studio

If you are using Visual Studio 2022:

  1. Launch Visual Studio.
  2. Select "Continue without code" if prompted.
  3. From the Visual Studio start window, select "Install more tools and features."
  4. In the Visual Studio Installer, navigate to the "Workloads" tab.
  5. Under "Other toolsets," make sure ".NET Multi-platform App UI development" is checked.
  6. If it's not installed, click "Install."

After the installation is complete, restart Visual Studio.

Verifying Your Installation

To verify that your setup is correct, you can create a new .NET MAUI project:

  1. Open Visual Studio.
  2. Click "Create a new project."
  3. Search for ".NET MAUI App" and select the template.
  4. Click "Next."
  5. Enter a project name (e.g., "MyMauiApp") and choose a location.
  6. Click "Next" and then "Create."

Visual Studio will create your new .NET MAUI project. You can then select your target platform (e.g., Windows Machine, Android Emulator, iOS Simulator) from the dropdown menu and click the "Start Debugging" button to run your application.

For the first run, Visual Studio might download and install additional platform-specific components if they are missing.

Troubleshooting Common Issues

Congratulations! You have successfully set up your development environment for .NET MAUI. You are now ready to build your first cross-platform application.

Next: Creating Your First .NET MAUI App