liveBook · Manning

Visual Studio workload

As explained in .NET MAUI in Action

A .NET workload is an installable component that adds a specialized development platform or toolchain to .NET.

A .NET workload is an installable part of .NET that provides a specialized development platform or toolchain. .NET MAUI is a workload, not an independently installed SDK, so it is treated as a core part of the .NET development experience. section 1.2

This matters because MAUI development can use familiar .NET tools and services: Visual Studio, Visual Studio Code, the .NET CLI, build and DevOps tools, and NuGet packages. A workload makes MAUI projects fit the same broader ecosystem as other .NET projects. section 1.4

Before creating a MAUI app, prepare the workload and choose a workflow:

  • Install the .NET MAUI workload through the Visual Studio installer or the .NET CLI. section 2.1
  • Install the blank MAUI project template separately when following a blank-project workflow. section 2.1
  • Use Visual Studio for a first-class experience, or use Visual Studio Code and the .NET CLI if that suits your workflow. section 1.4 section 2.1
  • Use command help such as dotnet new --help to discover template options and switches. section 2.1.2

Create a blank MAUI app

After installing the workload and blank template, create a folder, enter it, and run dotnet new blankmaui. The CLI generates a MAUI solution using the containing folder name by default. Supply -n and -o to choose a solution name and output directory instead, as in dotnet new blankmaui -n HelloWorld -o C:\code\HelloWorld. section 2.1 section 2.1.2

.Table 2.1 A summary of the .NET MAUI templates

Template name

Short name

Description

.NET MAUI App

maui

The main template used to create new .NET MAUI apps.

.NET MAUI Blazor App

maui-blazor

Used to create a new .NET MAUI app that uses Blazor to define its UI.

.NET MAUI Class Library

mauilib

Creates a new class library for sharing code between different .NET MAUI projects.

.NET MAUI ContentPage (C#)

maui-page-csharp

Creates a new .NET MAUI application page (see section 1.3) with the UI defined declaratively in C#.

.NET MAUI ContentPage

maui-page-xaml

Creates a new .NET MAUI application page with the UI defined in XAML markup (and a corresponding C# code-behind file).

.NET MAUI ContentView (C#)

maui-view-csharp

Creates a new .NET MAUI content view (a reusable UI component that can be used in .NET MAUI application pages) with the UI defined declaratively in C#.

.NET MAUI ContentView

maui-view-xaml

Creates a new .NET MAUI content view with the UI defined in XAML markup (and a corresponding C# code-behind file).

.NET MAUI ResourceDictionary (XAML)

maui-dict-xaml

Creates a new .NET MAUI resource dictionary in XAML. This allows you to define and name colors, styles, and templates that can be referenced by name for reuse throughout your app.

Blank .NET MAUI template

blankmaui

An additional template that I provide. It is the same as the default template (maui), except the default template uses Shell (which we won’t talk about until chapter 5). This template does not use Shell, so it should be easier to work with for the first few chapters.

Compare the MAUI CLI templates to choose a standard app, Blazor app, shared class library, page, or reusable view starting point. section 2.1.2

Choose a template that matches the task: use maui for a standard app, maui-blazor for a MAUI app with a Blazor-defined UI, and mauilib for code intended to be shared among MAUI projects. Template inputs and switches follow the same conventions as other .NET templates. section 2.1.2

How .NET MAUI in Action covers it

How deep it goes
Defines MAUI as a .NET workload and gives installation and CLI-template procedures, deferring detailed setup guidance to an appendix.
Examples
Uses AlohaWorld and HelloWorld projects to demonstrate dotnet new blankmaui and its naming and output switches.
What it assumes
Assumes access to .NET development tools while teaching workload installation, template discovery, and basic CLI help from zero.
What you can do after
Operate/configure it by installing the MAUI workload and generating projects with Visual Studio or dotnet new templates.
How it connects
Connects .NET MAUI with the .NET CLI, Visual Studio, Visual Studio Code, NuGet, Blazor, and ASP.NET Core.

Related concepts

This explainer was generated by Manning's knowledge graph from the text of .NET MAUI in Action. The section links point to the parts of the book it draws on.