Install .NET MAUI
This guide will walk you through the steps to install .NET MAUI (Multi-platform App UI), enabling you to build native cross-platform applications for Windows, macOS, Android, and iOS using a single codebase.
Prerequisites
Before you begin, ensure you have the following installed:
- Visual Studio 2022 (Version 17.3 or later): Make sure the ".NET Multi-platform App UI development" workload is selected.
- .NET SDK: .NET MAUI requires the latest .NET SDK. Visual Studio installer usually handles this, but you can also download it separately from the official .NET website.
Tip
For the best experience, we recommend using the latest stable version of Visual Studio.
Installation Steps
1. Visual Studio Installer
If you already have Visual Studio 2022 installed, launch the Visual Studio Installer. If not, download and run it from the Visual Studio website.
In the Visual Studio Installer, select the ".NET Multi-platform App UI development" workload. This will automatically select necessary components, including:
- .NET MAUI
- Windows App SDK
- Mobile Development options (Android, iOS)
Click Modify or Install to begin the installation.
2. Command-Line Installation (Optional)
You can also install .NET MAUI via the command line using the .NET SDK's NuGet package manager.
Open your terminal or command prompt and run the following command:
dotnet workload install maui
This command will download and install the necessary workloads for .NET MAUI development.
Note
The command-line installation might require administrative privileges on some systems.
3. SDK Command-Line Tools
If you plan to develop without an IDE, ensure you have the .NET SDK installed. You can verify your installation by running:
dotnet --list-sdks
And check for the MAUI workload:
dotnet workload list
Verifying Installation
Once the installation is complete, you can verify it by creating a new .NET MAUI project:
- Open Visual Studio.
- Click "Create a new project".
- Search for ".NET MAUI App" and select the template.
- Follow the prompts to name your project and choose a location.
- Click "Create".
If the project creates successfully and you can build and run it on a simulator or device, your installation is complete.
macOS Specifics
On macOS, you'll also need Xcode installed for iOS and macOS development. Ensure you have the latest version of Xcode from the App Store.
You might need to run the following command in your terminal to install the necessary components for macOS development:
dotnet workload install maui-ios
dotnet workload install maui-maccatalyst
Troubleshooting
If you encounter issues during installation:
- Ensure your operating system and Visual Studio are up to date.
- Check the Troubleshooting Guide for common solutions.
- Verify that all required components for your target platforms (Windows, Android, iOS, macOS) are selected in the Visual Studio Installer.
You are now ready to start building stunning cross-platform applications with .NET MAUI!