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

Run your app

This tutorial will focus on deploying a .NET MAUI application to your local Windows machine first. Later, you'll have the option to set up an Android device or emulator.

In the Visual Studio toolbar, you should see Windows Machine as the debug target by default. Press the Windows Machine button to build and run the app:

Windows Machine selected as target deployment by default

In the running app, select the Click me button a few times and observe that the count of the number of button clicks is incremented:

.NET MAUI app running on Windows. A 'Hello, World!' message is displayed.

This tutorial will focus on deploying a .NET MAUI application to your local Mac machine first. Later, you'll have the option to run on an iOS simulator.

In the bottom right of the VS Code window, you should see curly braces in the Status Bar. Click on the curly braces, and you should see My Mac selected as the default debug target.

My Mac selected as target deployment by default

If you don't see the curly braces in the Status Bar, make sure to have a relevant project file open like a .cs, .xaml, or .csproj file that belongs to the .NET MAUI project. Alternatively, you can open the command palette in VS Code by pressing CMD+SHIFT+P. And then type .NET MAUI: Pick. That will show you the options to pick a debug platform for your project.

If you don't see anything selected, click on Debug Target and select My Mac from the list. Please note, it may not be the first item in your list upon the first time selecting a debug target.

VS Code debug target list

To run the app, click the Run and Debug icon in the VS Code Activity Bar. Then click Run and Debug.

VS Code run and debug pane

In the running app, select the Click me button a few times and observe that the count of the number of button clicks is incremented:

.NET MAUI app running on Mac. A 'Hello, World!' message is displayed.

Congratulations, you've built and run your first .NET MAUI app! Keep the app running and continue the tutorial.

Continue