Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
.NET MAUI Cross-Platform Application Development

You're reading from   .NET MAUI Cross-Platform Application Development Leverage a first-class cross-platform UI framework to build native apps on multiple platforms

Arrow left icon
Product type Paperback
Published in Jan 2023
Publisher Packt
ISBN-13 9781800569225
Length 400 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Roger Ye Roger Ye
Author Profile Icon Roger Ye
Roger Ye
Arrow right icon
View More author details
Toc

Table of Contents (18) Chapters Close

Preface 1. Part 1: Exploring .NET MAUI
2. Chapter 1: Getting Started with .NET MAUI FREE CHAPTER 3. Chapter 2: Building Our First .NET MAUI App 4. Chapter 3: User Interface Design with XAML 5. Chapter 4: Exploring MVVM and Data Binding 6. Chapter 5: Navigation using .NET MAUI Shell and NavigationPage 7. Chapter 6: Introducing Dependency Injection and Platform-Specific Services 8. Part 2: Implementing .NET MAUI Blazor
9. Chapter 7: Introducing Blazor Hybrid App Development 10. Chapter 8: Understanding the Blazor Layout and Routing 11. Chapter 9: Implementing Blazor Components 12. Chapter 10: Advanced Topics in Creating Razor Components 13. Part 3: Testing and Deployment
14. Chapter 11: Developing Unit Tests 15. Chapter 12: Deploying and Publishing in App Stores 16. Index 17. Other Books You May Enjoy

Development environment setup

Both Windows and macOS can be used for .NET MAUI development, but you won’t be able to build all targets with only one of them. You will need both Windows and Mac computers to build all targets. In this book, the Windows environment is used to build and test Android and Windows targets. iOS and macOS targets are built on a Mac computer.

.NET MAUI app can target the following platforms:

  • Android 5.0 (API 21) or higher
  • iOS 10 or higher
  • macOS 10.13 or higher, using Mac Catalyst
  • Windows 11 and Windows 10 version 1809 or higher, using Windows UI Library (WinUI) 3

.NET MAUI Blazor apps use the platform-specific WebView control, so they have the following additional requirements:

  • Android 7.0 (API 24) or higher
  • iOS 14 or higher
  • macOS 11 or higher, using Mac Catalyst

.NET MAUI build targets of Android, iOS, macOS, and Windows can be built using Visual Studio on a Windows computer. In this environment, a networked Mac is required to build iOS and macOS targets. Xcode must be installed on the paired Mac to debug and test an iOS MAUI app in a Windows development environment.

.NET MAUI targets of Android, iOS, and macOS can be built and tested on macOS.

Target platform

Windows

macOS

Windows

Yes

No

Android

Yes

Yes

iOS

Yes (pair to Mac)

Yes

macOS

Build only (pair to Mac)

Yes

Table 1.6: The development environment of .NET MAUI

Please refer to Table 1.6 to find out the build configurations on Windows and macOS.

Installing .NET MAUI on Windows

.NET MAUI can be installed as part of Visual Studio 2022. The Visual Studio Community edition is free, and we can download it from the Microsoft website at https://visualstudio.microsoft.com/vs/community/.

After launching Visual Studio Installer, we will see a screen similar to the one shown in Figure 1.3. Please select .NET Multi-platform App UI development and .NET desktop development in the list of options. We also need to select ASP.NET and web development for the .NET MAUI Blazor app, which will be covered in Part 2 of this book.

Figure 1.3: Visual Studio 2022 installation

Figure 1.3: Visual Studio 2022 installation

After the installation is completed, we can check the installation from the command line using the following dotnet command:

C:\>dotnet workload list
Installed Workload Ids  Manifest Version    Installation Source
--------------------------------------------------------------------
maui-windows          6.0.486/6.0.400       VS 17.3.32811.315
maui-maccatalyst      6.0.486/6.0.400       VS 17.3.32811.315
maccatalyst           15.4.446-ci.-release-6-0-4xx.446/6.0.400      VS 17.3.32811.315
maui-ios              6.0.486/6.0.400         VS 17.3.32811.315
ios                    15.4.446-ci.-release-6-0-4xx.446/6.0.400      VS 17.3.32811.315
maui-android          6.0.486/6.0.400         VS 17.3.32811.315
android               32.0.448/6.0.400        VS 17.3.32811.315
Use `dotnet workload search` to find additional workloads to install.

We are ready to create, build, and run a .NET MAUI app on Windows.

Installing .NET MAUI on macOS

The installation of the Visual Studio Community edition is similar to what we have done on Windows. The installation package can be downloaded from the same link.

After launching Visual Studio Installer, we can see a screen similar to the one shown in Figure 1.4.

Figure 1.4: Visual Studio for Mac 2022 installation

Figure 1.4: Visual Studio for Mac 2022 installation

Please select .NET and .NET MAUI from the list of options in Figure 1.4.

After the installation is completed, we can check the installation from the command line using the following dotnet command:

% dotnet workload list
Installed Workload Ids      Manifest Version      Installation Source
--------------------------------------------------------------------
wasm-tools                  6.0.9/6.0.400         SDK 6.0.400
macos                       12.3.453/6.0.400      SDK 6.0.400
maui-maccatalyst            6.0.536/6.0.400       SDK 6.0.400
maui-ios                    6.0.536/6.0.400       SDK 6.0.400
maui-android                6.0.536/6.0.400       SDK 6.0.400
ios                         15.4.453/6.0.400      SDK 6.0.400
maccatalyst                 15.4.453/6.0.400      SDK 6.0.400
maui                        6.0.536/6.0.400       SDK 6.0.400
tvos                        15.4.453/6.0.400      SDK 6.0.400
android                     32.0.465/6.0.400      SDK 6.0.400
Use `dotnet workload search` to find additional workloads to install.

We are ready to create, build, and run a .NET MAUI app on macOS.

You have been reading a chapter from
.NET MAUI Cross-Platform Application Development
Published in: Jan 2023
Publisher: Packt
ISBN-13: 9781800569225
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at $19.99/month. Cancel anytime
Banner background image