Setting up the project
.NET MAUI introduces a new code-sharing paradigm called single project. Previously, in Xamarin.Forms, you would have had a separate project for each platform your app would be deployed to. In .NET MAUI, all platforms are in a single project that is multi-targeted to all the supported platforms. By default, all code is considered shared, unless it is in one of the platform-specific subfolders. We will explore this further as we progress through this and future chapters.
Let’s get started!
Creating the new project
The first step is to create a new .NET MAUI project. Open Visual Studio 2022 and select Create a new project:
Figure 2.1 – Visual Studio 2022
This will open the Create a new project wizard. In the search field, type in maui
and select the .NET MAUI App item from the list:
Figure 2.2 – Create a new project
Complete the next page of the wizard by naming your project...