Introduction

Visual Studio 2022 17.3 Preview を Hyper-V に入れた Windows 11 上で試してみた。
そのついでに .NET MAUI (.NET Multi-Platform App UI) でサンプルアプリを動かしてみた。

その過程で起きたトラブルのメモとか。

What happened?

MAUI のプロジェクトテンプレートが見当たらない

いきなりぶつかった壁。

missing

Visual Studio の新規作成で MAUI のプロジェクトが見当たらなくて焦りました。

実は テンプレートがありません という既知の問題で、対応策がある。

1
$ dotnet new maui

コマンドプロンプトでプロジェクトを作れと。
えぇ…

ちなみに MAUI Templates are missing in VS 2022 17.3.0 Preview 1.1 という issue で

If the templates are not installed you can run dotnet new -i Microsoft.Maui.Templates to still get them. Please do not use the version that is at the end, especially not the one as advertized here because that is an older version. If you do not specify a version the newest ones will be installed.

とあるので、

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
$ dotnet new -i Microsoft.Maui.Templates

The following template packages will be installed:
Microsoft.Maui.Templates

Success: Microsoft.Maui.Templates::6.0.312 installed the following templates:
Template Name Short Name Language Tags
-------------------------------- ---------------- -------- ---------------------------------------------------------
.NET MAUI App maui [C#] MAUI/Android/iOS/macOS/Mac Catalyst/Windows/Tizen
.NET MAUI Blazor App maui-blazor [C#] MAUI/Android/iOS/macOS/Mac Catalyst/Windows/Tizen/Blazor
.NET MAUI Class Library mauilib [C#] MAUI/Android/iOS/macOS/Mac Catalyst/Windows/Tizen
.NET MAUI ContentPage (C#) maui-page-csharp [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ContentPage (XAML) maui-page-xaml [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ContentView (C#) maui-view-csharp [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ContentView (XAML) maui-view-xaml [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ResourceDictionary ... maui-dict-xaml [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Xaml/Code

と試しても、何も変わらない状態だった。

nuget で復元できない

これもかなり謎。
プロジェクトを作成して試しにビルドした時のエラーがこちら。

build error

Unable to find package Microsoft.Extensions.Configuration. No packages exist with this id in source(s): C:\Program Files\dotnet\library-packs, Microsoft Visual Studio Offline Packages

原因は nuget の設定が空になっていたこと。

package sources

なので、

package sources

nuget.orghttps://api.nuget.org/v3/index.json を追加してあげる。

for Windows

開発者モードが必要

ビルドできるターゲットは下記のように現時点で 4 つある。

target

そのうち、Windows Machine をビルドしようとすると

target

This device needs to be set up correctly to develop this type of app for Windows. If you don’t, then you can’t install and test your app before you submit it to the Windows Store.
Go to settings for developers on your device, and select Developer Mode.
This device is not currently in developer mode.

開発者モードじゃないよ?って怒られる。

これは UWP でもお馴染みなので素直に従う。

for developers

設定変更後、ビルドが成功し、下記のアプリが起動する。

windows

なお、パッケージされているのか、UWP でみたようなことになる。

package

for Android

Android Simulator が起動しない

結論から言うと、HAXM は使えないように思える。
インストールしても Visual Studio が認識なかったので。

対応策は Hyper-V なのだが、はまりどころが意外とある。

Nested Virtualization (入れ子になった仮想化) を有効化しろ

今回の検証が Hyper-V で行われているためで、本来の物理マシンでの作業ならこの作業は不要。

既定では Nested Virtualization は無効になっているため、個々の仮想マシンに対して設定を有効にしていく必要がある。

Powershell を起動し、設定を変更する仮想マシンがシャットダウンしていることを確認し、下記のコマンドを実行する。

1
Set-VMProcessor -VMName <VMName> -ExposeVirtualizationExtensions $true

この設定を行わないと、仮想マシン内で Hyper-V を有効化できない。

Hyper-V をインストールする

当たり前だが一応。
Windows の機能と追加から

  • Hyper-V
  • Windows Hypervisor Platform

をインストールする。

target

target

前者は無くてもいいかもしれないが、一応入れた。

Android SDK をインストール

Xamarin を使っていれば当たり前のこと。
適宜インストールすること。

Android Device Manager でデバイスを作成

これも Xamarin を使っていれば当たり前のこと。
今回は Android 11.0 API 30 の Pixel 5 を用意。

android device manager

ここまでくれば、いつものごとく Android Simulator でアプリが動く。

android

for iOS

Xcode 13.3 が必要

無慈悲なエラー。

ios paring

Xcode のサポートは下記の通り。

https://developer.apple.com/jp/support/xcode/

つまり、macOS Monterey 12 未満の OS では、MAUI で iOS アプリを作成できない。

どうしようもないので、素直にアップデートしましょう。

アップデートさえ終われば、これも Xamarin のように素直に起動する。

ios

初期位置が他と違っておかしいのは原因不明。
(click me を押したら治った)

for macOS

Mac Catalyst のビルドは現在サポートしていません

だそうです。
今は mac から実行しろってことです。

build error

Debugging Mac Catalyst on Windows is not currently supported.

ちなみに Mac Catalyst とは wiki によれば

macOS向けアプリの開発用フレームワークであり、アプリの実行環境

だそうです。

私はこの名前を見て思い出したのが AMD (Advanced Micro Devices, Inc.) のドライバソフトウェア AMD Catalyst

No templates found matching

ところかわって macOS (Visual Studio 2022 for mac) からの実行。
Windows で見たような光景だが、こっちはコンソールから。

1
2
% dotnet new maui
No templates found matching: 'maui'.

これに対しては、下記のコマンドが必須。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
% dotnet new -i Microsoft.Maui.Templates
The following template packages will be installed:
Microsoft.Maui.Templates

Success: Microsoft.Maui.Templates::6.0.312 installed the following templates:
Template Name Short Name Language Tags
----------------------------------- ---------------- -------- ---------------------------------------------------------
.NET MAUI App maui [C#] MAUI/Android/iOS/macOS/Mac Catalyst/Windows/Tizen
.NET MAUI Blazor App maui-blazor [C#] MAUI/Android/iOS/macOS/Mac Catalyst/Windows/Tizen/Blazor
.NET MAUI Class Library mauilib [C#] MAUI/Android/iOS/macOS/Mac Catalyst/Windows/Tizen
.NET MAUI ContentPage (C#) maui-page-csharp [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ContentPage (XAML) maui-page-xaml [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ContentView (C#) maui-view-csharp [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ContentView (XAML) maui-view-xaml [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Tizen/Xaml/Code
.NET MAUI ResourceDictionary (XAML) maui-dict-xaml [C#] MAUI/Android/iOS/macOS/Mac Catalyst/WinUI/Xaml/Code

nuget で復元できない

これは別の原因。
net6.0-maccatalyst を指定してビルドするつもりなのに、nuget の復元ではソリューション全部を指定しているから、それに引きずられてエラーになっている。

build error

error NETSDK1147: このプロジェクトをビルドするには、次のワークロードをインストールする必要があります: maui-android
これらのワークロードをインストールするには、次のコマンドを実行します: dotnet workload restore

別に、対応する必要はないけど。
ちなみに管理者権限必須。

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
% sudo dotnet workload restore
Password:

Welcome to .NET 6.0!
---------------------
SDK Version: 6.0.302

Telemetry
---------
The .NET tools collect usage data in order to help us improve your experience. It is collected by Microsoft and shared with the community. You can opt-out of telemetry by setting the DOTNET_CLI_TELEMETRY_OPTOUT environment variable to '1' or 'true' using your favorite shell.

Read more about .NET CLI Tools telemetry: https://aka.ms/dotnet-cli-telemetry

----------------
Installed an ASP.NET Core HTTPS development certificate.
To trust the certificate run 'dotnet dev-certs https --trust' (Windows and macOS only).
Learn about HTTPS: https://aka.ms/dotnet-https
----------------
Write your first app: https://aka.ms/dotnet-hello-world
Find out what's new: https://aka.ms/dotnet-whats-new
Explore documentation: https://aka.ms/dotnet-docs
Report issues and find source on GitHub: https://github.com/dotnet/core
Use 'dotnet --help' to see available commands or visit: https://aka.ms/dotnet-cli
--------------------------------------------------------------------------------------
Installing workloads: maui-android maui-ios maui-maccatalyst

Skipping NuGet package signature verification.
Skipping NuGet package signature verification.
Installing workload manifest microsoft.net.sdk.tvos version 15.4.315…
Installing workload manifest microsoft.net.sdk.android version 32.0.424…
Installing workload manifest microsoft.net.sdk.maui version 6.0.408…
Installing workload manifest microsoft.net.sdk.macos version 12.3.315…
Installing workload manifest microsoft.net.sdk.maccatalyst version 15.4.315…
Installing workload manifest microsoft.net.sdk.ios version 15.4.315…
Installing workload manifest microsoft.net.workload.mono.toolchain version 6.0.7…
Installing pack Microsoft.Maui.Core.Ref.android version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.android version 6.0.408...
Installing pack Microsoft.Maui.Core.Runtime.android version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.android version 6.0.408...
Installing pack Microsoft.Maui.Controls.Ref.android version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.android version 6.0.408...
Installing pack Microsoft.Maui.Controls.Runtime.android version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.android version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Ref.android version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.android version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Runtime.android version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.android version 6.0.408...
Installing pack Microsoft.AspNetCore.Components.WebView.Maui version 6.0.408...
Writing workload pack installation record for Microsoft.AspNetCore.Components.WebView.Maui version 6.0.408...
Installing pack Microsoft.Maui.Dependencies version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Dependencies version 6.0.408...
Installing pack Microsoft.Maui.Sdk version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Sdk version 6.0.408...
Installing pack Microsoft.Maui.Extensions version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Extensions version 6.0.408...
Installing pack Microsoft.Maui.Graphics version 6.0.403...
Writing workload pack installation record for Microsoft.Maui.Graphics version 6.0.403...
Installing pack Microsoft.Maui.Resizetizer.Sdk version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Resizetizer.Sdk version 6.0.408...
Installing pack Microsoft.Maui.Templates-6.0 version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Templates-6.0 version 6.0.408...
Installing pack Microsoft.Maui.Core.Ref.any version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.any version 6.0.408...
Installing pack Microsoft.Maui.Core.Runtime.any version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.any version 6.0.408...
Installing pack Microsoft.Maui.Controls.Ref.any version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.any version 6.0.408...
Installing pack Microsoft.Maui.Controls.Runtime.any version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.any version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Ref.any version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.any version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Runtime.any version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.any version 6.0.408...
Installing pack Microsoft.Android.Sdk version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Sdk version 32.0.424...
Installing pack Microsoft.Android.Ref.31 version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Ref.31 version 32.0.424...
Installing pack Microsoft.Android.Ref.32 version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Ref.32 version 32.0.424...
Installing pack Microsoft.Android.Runtime.32.android-arm version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Runtime.32.android-arm version 32.0.424...
Installing pack Microsoft.Android.Runtime.32.android-arm64 version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Runtime.32.android-arm64 version 32.0.424...
Installing pack Microsoft.Android.Runtime.32.android-x86 version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Runtime.32.android-x86 version 32.0.424...
Installing pack Microsoft.Android.Runtime.32.android-x64 version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Runtime.32.android-x64 version 32.0.424...
Installing pack Microsoft.Android.Templates version 32.0.424...
Writing workload pack installation record for Microsoft.Android.Templates version 32.0.424...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-arm version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-arm64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-x64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-x64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.android-x86 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.android-x86 version 6.0.7...
Installing pack Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.7...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoAOTCompiler.Task version 6.0.7...
Installing pack Microsoft.NET.Runtime.MonoTargets.Sdk version 6.0.7...
Writing workload pack installation record for Microsoft.NET.Runtime.MonoTargets.Sdk version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.android-x86 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.android-x86 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.android-x64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.android-x64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.android-arm64 version 6.0.7...
Installing pack Microsoft.Maui.Core.Ref.ios version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.ios version 6.0.408...
Installing pack Microsoft.Maui.Core.Runtime.ios version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.ios version 6.0.408...
Installing pack Microsoft.Maui.Controls.Ref.ios version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.ios version 6.0.408...
Installing pack Microsoft.Maui.Controls.Runtime.ios version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.ios version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Ref.ios version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.ios version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Runtime.ios version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.ios version 6.0.408...
Installing pack Microsoft.iOS.Sdk version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Sdk version 15.4.315...
Installing pack Microsoft.iOS.Ref version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Ref version 15.4.315...
Installing pack Microsoft.iOS.Runtime.ios-arm version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Runtime.ios-arm version 15.4.315...
Installing pack Microsoft.iOS.Runtime.ios-arm64 version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Runtime.ios-arm64 version 15.4.315...
Installing pack Microsoft.iOS.Runtime.iossimulator-x86 version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Runtime.iossimulator-x86 version 15.4.315...
Installing pack Microsoft.iOS.Runtime.iossimulator-x64 version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Runtime.iossimulator-x64 version 15.4.315...
Installing pack Microsoft.iOS.Runtime.iossimulator-arm64 version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Runtime.iossimulator-arm64 version 15.4.315...
Installing pack Microsoft.iOS.Templates version 15.4.315...
Writing workload pack installation record for Microsoft.iOS.Templates version 15.4.315...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.ios-arm64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-arm64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.iossimulator-x86 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.ios-arm version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.ios-arm version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.ios-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.ios-arm64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.iossimulator-arm64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.iossimulator-x64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.iossimulator-x86 version 6.0.7...
Installing pack Microsoft.Maui.Core.Ref.maccatalyst version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Ref.maccatalyst version 6.0.408...
Installing pack Microsoft.Maui.Core.Runtime.maccatalyst version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Core.Runtime.maccatalyst version 6.0.408...
Installing pack Microsoft.Maui.Controls.Ref.maccatalyst version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Ref.maccatalyst version 6.0.408...
Installing pack Microsoft.Maui.Controls.Runtime.maccatalyst version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Controls.Runtime.maccatalyst version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Ref.maccatalyst version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Ref.maccatalyst version 6.0.408...
Installing pack Microsoft.Maui.Essentials.Runtime.maccatalyst version 6.0.408...
Writing workload pack installation record for Microsoft.Maui.Essentials.Runtime.maccatalyst version 6.0.408...
Installing pack Microsoft.MacCatalyst.Sdk version 15.4.315...
Writing workload pack installation record for Microsoft.MacCatalyst.Sdk version 15.4.315...
Installing pack Microsoft.MacCatalyst.Ref version 15.4.315...
Writing workload pack installation record for Microsoft.MacCatalyst.Ref version 15.4.315...
Installing pack Microsoft.MacCatalyst.Runtime.maccatalyst-arm64 version 15.4.315...
Writing workload pack installation record for Microsoft.MacCatalyst.Runtime.maccatalyst-arm64 version 15.4.315...
Installing pack Microsoft.MacCatalyst.Runtime.maccatalyst-x64 version 15.4.315...
Writing workload pack installation record for Microsoft.MacCatalyst.Runtime.maccatalyst-x64 version 15.4.315...
Installing pack Microsoft.MacCatalyst.Templates version 15.4.315...
Writing workload pack installation record for Microsoft.MacCatalyst.Templates version 15.4.315...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-arm64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-x64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.AOT.Cross.maccatalyst-x64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.maccatalyst-arm64 version 6.0.7...
Installing pack Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64 version 6.0.7...
Writing workload pack installation record for Microsoft.NETCore.App.Runtime.Mono.maccatalyst-x64 version 6.0.7...
Garbage collecting for SDK feature band(s) 6.0.300...

Successfully installed workload(s) maui-android maui-ios maui-maccatalyst.

Visual Studio for mac は立ち上げなおした方がいい。

再度ビルドするとアプリが起動する。

mac catalyst