.NET MAUI Tutorial - Build your first multi-platform app in C#
Download and install
-
Download and install the .NET SDK:
Download .NET 8 SDK x64 (Intel)
Download .NET 8 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.
-
Download and install VS Code:
-
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.
This extension comes with the C# Dev Kit and the C# extensions, which are required for the .NET MAUI extension to run.
-
Open a new terminal and install the .NET MAUI workload by running the following command:
Terminalsudo dotnet workload install maui
If the installation succeeded, you should see an output similar to the following:
TerminalSuccesfully 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.
In your terminal, run the following command to check your installation.
dotnet
If the installation succeeded, you should see an output similar to the following:
Usage: dotnet [options]
Usage: dotnet [path-to-application]
Options:
-h|--help Display help.
--info Display .NET information.
--list-sdks Display the installed SDKs.
--list-runtimes Display the installed runtimes.
path-to-application:
The path to an application .dll file to execute.
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:
-
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.
After installing Xcode, you must open Xcode and agree to the license agreements and install optional components, if prompted.
-
When asked what platforms you'd like to develop for, select platforms macOS and iOS and then select Download & Install.
-
Open a new terminal and install the Xcode command line developer tools by running the following command:
Terminalxcode-select --install
When prompted to install Xcode command line developer tools, select Install. Lastly, agree to the license agreement.
If everything looks good, select the Continue button below to go to the next step.