0% found this document useful (0 votes)
18 views11 pages

First Steps with .NET MAUI App

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views11 pages

First Steps with .NET MAUI App

Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

Build your first app

06/30/2025

In this tutorial, you'll learn how to create and run your first .NET Multi-platform App UI (.NET
MAUI) app in Visual Studio 2022 on Windows or Visual Studio Code on Windows, macOS, or
Linux. This will help to ensure that your development environment is correctly set up.

Visual Studio

Prerequisites
Visual Studio 2022 17.12 or greater, with the .NET Multi-platform App UI workload
installed. For more information, see Installation.

Create an app
In this tutorial, you'll create your first .NET MAUI app in Visual Studio 2022 and run it on an
Android emulator:
1. Launch Visual Studio 2022. In the start window, click Create a new project to create a
new project:
2. In the Create a new project window, select MAUI in the All project types drop-
down, select the .NET MAUI App template, and click the Next button:

3. In the Configure your new project window, name your project, choose a suitable
location for it, and click the Next button:

4. In the Additional information window, choose the version of .NET that you'd like to
target and click the Create button:
5. Wait for the project to be created and its dependencies to be restored:

6. In the Visual Studio toolbar, use the Debug Target drop-down to select Android
Emulators and then the Android Emulator entry:
7. In the Visual Studio toolbar, press the Android Emulator button:

Visual Studio will start the process of installing the default Android SDK and Android
Emulator.
8. In the Android SDK - License Agreement window, press the Accept button:

9. In the User Account Control dialog, press the Yes button:


Wait for Visual Studio to download the default Android SDK and Android Emulator.
10. In the User Account Control dialog, press the Yes button:

11. In the Android SDK Platform is missing dialog, press the Install button:

12. In the Android SDK - License Agreement window, press the Accept button:
Wait for Visual Studio to install the Android SDK components.

13. In the New Device window, press the Create button:

Wait for Visual Studio to download, unzip, and create an Android emulator.
14. Close the Android Device Manager window:

15. In the Visual Studio toolbar, press the Pixel 7 - API 35 (Android 15.0 - API 35) button:

16. In the Android SDK - License Agreement window, press the Accept button:
17. In the User Account Control dialog, press the Yes button:

Wait for Visual Studio to install to download the Android SDK.

18. In the Visual Studio toolbar, press the Pixel 7 - API 35 (Android 15.0 - API 35) button
to build and run the app:
Visual Studio will start the Android emulator, build the app, and deploy the app to
the emulator.

2 Warning

Hardware acceleration must be enabled to maximize Android emulator


performance. Failure to do this will result in the emulator running very slowly.
For more information, see How to enable hardware acceleration with Android
emulators (Hyper-V & AEHD).

19. In the running app in the Android emulator, press the Click me button several times
and observe that the count of the number of button clicks is incremented.
Troubleshooting
If your app fails to compile, review Troubleshooting known issues, which may have a
solution to your problem. If the problem is related to the Android emulator, see Android
emulator troubleshooting.
Next steps
In this tutorial, you've learned how to create and run your first .NET Multi-platform App UI
(.NET MAUI) app.

To learn the fundamentals of building an app with .NET MAUI, see Create a .NET MAUI app.
Alternatively, for a full .NET MAUI training course, see Build mobile and desktop apps with .NET
MAUI.

You might also like