[WIP] .NET MAUI で Linux 向けにビルドしたい!

.NET MAUI とは
.NET MAUI は C# と XAML により GUI クロスプラットフォームアプリケーションを開発できるフレームワークです。
Linux 版
しかし、登場した当時は Linux 版はコミュニティーによる開発扱いで、現在はもはや Linux の存在は公式ドキュメントから削除されています。
現在のコミュニティーによる開発は、ほとんど停滞しており、その開発の情報はほとんど存在しません。
この資料の目的
この資料は .NET MAUI を Linux でなんとか利用できないか試み、情報をある程度まとめたものです。

参考になるページ
リポジトリ
-
dotnet/maui (本家)
-
jsuarezruiz/maui-linux (MAUI Linux のすべてが集まっているフォーク)
- Iytico/maui (MAUI Linux のメインの開発者のフォーク)
- nblockchain/Mali (MAUI のフォーク)
-
jsuarezruiz/maui-linux (MAUI Linux のすべてが集まっているフォーク)
下2つは、#66などで maui-linux にマージしています。このリポジトリの保持者である jsuarezruiz さんも今はあんまり MAUI Linux の開発に関与していないようです。
コミュニティー
本家の wiki でも強い要望があるにも関わらず、MS やコミュニティーによる開発はあまり進んでいません。(というか、興味がある人は多いけど、開発資料が少なすぎて途中参入が難しいんだとおもう)
(まじで情報がない)

ビルドとかの方針
これは指針であり、まだ成功はしていません。
A 案
Windows や macOS 上でのビルドと同様に行う (多分無理)
-> Linux 上では maui-android
以外使えないので、ビルドエラーが大量に出る
B 案
CI/CD を参考にする
-> gtk
のワークロードがインストールできない
C 案
CI/CD をそのまま動かす (一番希望がある)
-> GitHub Actions をローカルで動かせる act
でできるかも (現状若干エラーが出てるけど頑張れば行けるか?)
-> B 案と同じで、gtk
のワークロードのインストールができない
D 案
自作する (無理)
-> Qt (Qt.NET (古い)) で作るとか (ライセンス的 (GPL/LGPL) に微妙な気がする)
結論
とりあえず C 案で進めます。B 案でもほぼ同じな気がしますが… (資料作るときは B 案のほうが act
とか入れなくてもいいので、簡単になりそう)

雑に URL を貼る
- ビルドエラー
- maui-gtk の example (あんまり参考にならない)
- ビルド方法?
- 一番の情報源 (開発者情報)
- Development (A 案で試したやつ) + これ
- コンパイル方法 (CI/CD のまま。CI/CD は動いているっぽいけど、ローカルでやっても動かない謎 (B 案/C 案))
- Mali の CI/CD
- act
CI/CD はバージョンがかなり古いので、すべて v4 に上げるのを推奨するよ

ぶっちゃけ、あと gtk
のワークロードさえインストールできれば動きそうな雰囲気ある
あと、多分これ (GTK ランタイム) は必要かも
sudo apt install libgtk-3-dev
sudo apt install libgtk-3-0

一応 act
の使い方をちょっと書いておく
-
gh
(GitHub CLI) をインストール
# 参考: https://github.com/cli/cli/blob/trunk/docs/install_linux.md
(type -p wget >/dev/null || (sudo apt update && sudo apt-get install wget -y)) \
&& sudo mkdir -p -m 755 /etc/apt/keyrings \
&& wget -qO- https://cli.github.com/packages/githubcli-archive-keyring.gpg | sudo tee /etc/apt/keyrings/githubcli-archive-keyring.gpg > /dev/null \
&& sudo chmod go+r /etc/apt/keyrings/githubcli-archive-keyring.gpg \
&& echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | sudo tee /etc/apt/sources.list.d/github-cli.list > /dev/null \
&& sudo apt update \
&& sudo apt install gh -y
-
act
をインストール
# 参考: https://nektosact.com/installation/gh.html
gh extension install https://github.com/nektos/gh-act
- Docker をインストール (よくわからないけど apt で全部入れた (?) 多分
docker.io
があればいいのかな?) - Docker 起動
sudo systemctl start docker
- ユーザーを
docker
グループに追加 (docker はスーパーユーザーが必要)
sudo usermod -aG docker $USER
newgrp docker # 変更を適応
- リポジトリをクローンして、その中に移動する
git clone <リポジトリの URL>
cd <クローンしたディレクトリ>
- 動かす
# 場所は、リポジトリのルートで実行 (ルートじゃなくても動くかも?)
gh act push
# または gh act pull_request かな?

ビルドできたら DLL 参照で動くと思う

# 参考: https://github.com/HavenDV/Gtk
curl -sSL https://raw.githubusercontent.com/HavenDV/Gtk/main/scripts/workload-install.sh | sudo bash
これやって、0.2.0はありません的なエラーが出たから、他の方法を試した。
(インストールできてないから dotnet workload list
には入らないけど、dotnet workload search
には入る)
# 参考: https://matrix.to/#/!secXICyMCTWkttVBVC:matrix.org/$uX3kcJ_AITkkFvqne3wkFJUL4_77o_FpfpGos6RphzI?via=matrix.org
git clone https://github.com/GtkSharp/GtkSharp.git
cd GtkSharp
sudo dotnet tool restore
sudo dotnet cake --BuildTarget=InstallWorkload
これやって、
# (これは元からインストールしてたっぽいから関係ない気がするけど)
sudo apt-get install libgtk-3-0
これやった後に、もう一度 sudo dotnet workload install gtk
したら、なぜかインストールできた
$ dotnet workload list
インストール済みワークロードの ID マニフェストのバージョン インストール ソース
-------------------------------------------------------
gtk 0.2.0/8.0.400 SDK 8.0.400
maui-android 8.0.82/8.0.100 SDK 8.0.400
wasi-experimental 8.0.8/8.0.100 SDK 8.0.400
`dotnet workload search` を使用して追加ワークロードを検出し、インストールします。

(なんか gtk
が入った後も、結構苦難している)

Mali は ZXing をビルドしてるっぽい (https://github.com/nblockchain/Mali/blob/master/.github/workflows/build-gtk.yml)
maui-linux は本体のビルド?
(https://github.com/jsuarezruiz/maui-linux/blob/main/.github/workflows/build-gtk.yml)

これ: https://github.com/lytico/maui/blob/6ef7f0c066808ea0d4142812ef4d956245e6a711/.github/workflows/build-gtk.yml#L22-L31
をやった後に Maui.Controls.Sample
(https://github.com/jsuarezruiz/maui-linux/pull/66 で利用されているサンプルプログラム) をビルドすると、Gtk あたりのエラーになる。
多分、これを解決すれば GUI が起動できる気がする。

色んな方法を試しすぎてて、再現性が低くなりそう (あとでちゃんとした資料を書くつもり (これが本来の目的だし))

そもそも VSCode で動作させたことがある人が過去に1人もいないかも
(メイン開発者たちは VS 使ってる (WSL かな?))

# 参考: https://github.com/jsuarezruiz/maui-linux/issues/92#issuecomment-2311842074
dotnet cake --target=dotnet-pack --workloads=global --gtk
dotnet new install ./artifacts/*.nupkg
を試して、
# (Nuget.config)
- <!-- <add key="local" value="artifacts" /> -->
+ <add key="local" value="artifacts" />
にした。
この後にビルドをすると、Gtk あたりのエラーは解消されたっぽい。
だけど、次のエラーが発生した。

System.Text.Json 8.0.0 が致命的な脆弱性があるというエラーが発生するので、バージョンを上げる。
# $(MicrosoftNETCoreAppRefPackageVersion) は8.0.0になってる
- <SystemTextJsonPackageVersion>$(MicrosoftNETCoreAppRefPackageVersion)</SystemTextJsonPackageVersion>
+ <SystemTextJsonPackageVersion>8.0.4</SystemTextJsonPackageVersion>
ついでに、ビルドターゲットの出力形式を変更する
- <!-- <OutputType Condition="$(TargetFramework.Contains('-'))">Exe</OutputType> -->
+ <OutputType>Exe</OutputType>

規定に関しても設定しなきゃいけないらしい
{
"profiles": {
"Windows Machine": {
"commandName": "MsixPackage",
"nativeDebugging": true
+ },
+ "Linux Machne": {
+ "commandName": "Project",
+ "nativeDebugging": true
}
}
}
あと、Main()
が必要らしい (Windows とかは /Platforms/Windows/App.xaml.cs
とかを参照にしてるっぽい)
public static void Main()
{
CreateMauiApp();
}

dotnet run --project src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj --framework net8.0
まだエラーは続く…
Unhandled exception. Microsoft.Maui.ApplicationModel.NotImplementedInReferenceAssemblyException: This functionality is not implemented in the portable version of this assembly. You should reference the NuGet package from your main application project in order to reference the platform-specific implementation.
at Microsoft.Maui.ApplicationModel.AppInfoImplementation.get_PackagingModel() in /home/lemon73/Downloads/maui-linux/src/Essentials/src/AppInfo/AppInfo.netstandard.cs:line 19
at Microsoft.Maui.ApplicationModel.AppInfo.get_PackagingModel() in /home/lemon73/Downloads/maui-linux/src/Essentials/src/AppInfo/AppInfo.shared.cs:line 106
at Maui.Controls.Sample.MauiProgram.<>c.<CreateMauiApp>b__4_3(IEssentialsBuilder essentials) in /home/lemon73/Downloads/maui-linux/src/Controls/samples/Controls.Sample/MauiProgram.cs:line 191
at Microsoft.Maui.Hosting.EssentialsExtensions.EssentialsRegistration.RegisterEssentialsOptions(IEssentialsBuilder essentials) in /home/lemon73/Downloads/maui-linux/src/Core/src/Hosting/EssentialsMauiAppBuilderExtensions.cs:line 110
at Microsoft.Maui.Hosting.EssentialsExtensions.EssentialsInitializer.Initialize(IServiceProvider services) in /home/lemon73/Downloads/maui-linux/src/Core/src/Hosting/EssentialsMauiAppBuilderExtensions.cs:line 131
at Microsoft.Maui.MauiContextExtensions.InitializeAppServices(MauiApp mauiApp) in /home/lemon73/Downloads/maui-linux/src/Core/src/MauiContextExtensions.cs:line 84
at Microsoft.Maui.Hosting.MauiAppBuilder.Build() in /home/lemon73/Downloads/maui-linux/src/Core/src/Hosting/MauiAppBuilder.cs:line 159
at Maui.Controls.Sample.MauiProgram.CreateMauiApp() in /home/lemon73/Downloads/maui-linux/src/Controls/samples/Controls.Sample/MauiProgram.cs:line 304
at Maui.Controls.Sample.MauiProgram.Main() in /home/lemon73/Downloads/maui-linux/src/Controls/samples/Controls.Sample/MauiProgram.cs:line 48
Essentials
でエラーが発生してるっぽいけど…なにこれ…

よくわからないので、一旦 Microsoft.Maui-vscode.sln
のビルドを目指すことに。

iOS でエラーになるので、.sln
から削除する。

$ dotnet run --project Microsoft.Maui-vscode.sln
# (エラー文)
/usr/share/dotnet/sdk/8.0.401/NuGet.targets(174,5): error : 無効なフレームワーク識別子 ''。 [/home/lemon73/Downloads/maui-linux/Microsoft.Maui-vscode.sln]
ビルドに失敗しました。ビルド エラーを修正して、もう一度実行してください。

global.json
に
{
"sdk": {
"version": "8.0.401"
}
}
を追加するも、特に効果はなし。

調節したら、別のエラーになった…
結局よくわからない
困難を極める

ついに動きました。詳しくは後で書きます。
おそらく、src/Controls/samples/Controls.Sample.Gtk/Controls.Sample.Gtk.csproj
は動くので、
dotnet run --project src/Controls/samples/Controls.Sample.Gtk/Controls.Sample.Gtk.csproj --framework net8.0-gtk
にします。
(画像の調整の必要あり (後で書く予定))
でも、UI が崩壊しているね… (おそらく仕様)

UI が崩壊しているのは、自分の Linux (KDE neon) 内で規定している GTK のテーマカラーが影響しているんじゃないかと思い、テーマカラーを上書きする設定にしたら、予想通り直った。
GTK_THEME=Adwaita:light dotnet run --project src/Controls/samples/Controls.Sample.Gtk/Controls.Sample.Gtk.csproj --framework net8.0-gtk
(GTK_THEME=Adwaita:light
を追加)
これで、一通り開発できるわね。既存のアプリケーションへの適応はできなさそうだけど、あとで試してみるかも。(Essential
あたりがほぼ実装されてない気がする)

実装状況はこれ: https://github.com/nblockchain/Mali/blob/master/Status.md
(更新が3年前だから、もっと実装されているかも)

xaml
での記述は無理かも?だけど、C# ではなんとか記述できるかも
とりあえず、コードの簡略化を進めますよん

現状 Mali で作業しているけど、maui-linux のほうが新しいデータが入ってていいかも

なんか、maui-linux でビルドしようとすると Graphics とか Essential でエラーが出るねぇ
あと、ios のワークロードが必要的な (Visual Studio なら動かせる?)
やっぱり Mali で動かすことにしよう。(ちょっと古いけど)

ターゲット指定できる?(試してない)

とりあえず Nuget (追記: 一時的なアップロードだし、GitHub Packages のほうがいいか) にあげてみようかな。ライセンス (MIT License) 的には大丈夫だし。

というか GitHub で現在の状況を公開したほうがいいか…?
面倒だからやってないけど

とりあえず Nuget (追記: 一時的なアップロードだし、GitHub Packages のほうがいいか) にあげてみようかな。ライセンス (MIT License) 的には大丈夫だし。
ということで、とりあえず Core
, Controls.Core
, Compatibility
の3つを以下のように編集しました。
<PropertyGroup>
...
- <IsPackable>false</IsPackable>
+ <!-- <IsPackable>false</IsPackable> -->
...
+ <PackageId>Lemon73.Microsoft.Maui.Controls</PackageId>
+ <Version>0.0.1</Version>
+ <Authors>Lemon73 and others</Authors>
+ <Company>Lemon's Resting Area and others</Company>
</PropertyGroup>
で Nuget 形式にパックする
dotnet pack src/Compatibility/Core/src/Compatibility.csproj
dotnet pack src/Core/src/Core.csproj
dotnet pack src/Controls/src/Core/Controls.Core.csproj
それを GitHub Packages で頒布
dotnet nuget push "artifacts/*.nupkg" --api-key (API キー) --source "github" --skip-duplicate
で頒布したのが以下のもの (あとで消すと思います。なので将来的にリンク切れするかも)
https://github.com/users/Lemon73-Computing/packages/nuget/package/Lemon73.Microsoft.Maui.Controlshttps://github.com/users/Lemon73-Computing/packages/nuget/package/Lemon73.Microsoft.Maui.Controls.Compatibilityhttps://github.com/users/Lemon73-Computing/packages/nuget/package/Lemon73.Microsoft.Maui
(なぜかバージョン指定がうまく行っていない気がする)
参考

あとで、実際に利用できるか試してみます。
(なぜかバージョン指定がうまく行っていない気がする)
あと、なぜか .net6 になってるので、.net8 でビルドしたい

あとで、実際に利用できるか試してみます。
依存関係的にこの3つだけでは動かないっぽい (もしかしたら全部ビルドする必要あるかも)
あと、なぜか .net6 になってるので、.net8 でビルドしたい
これは eng/Version.props
を変えれば良さそう (-dev
がついているのはよくわからない)

やっぱり、Mali は基本的に .net6 ベースだから、.net8 ベースの maui-linux を動かしたいな

とりあえず Nuget (追記: 一時的なアップロードだし、GitHub Packages のほうがいいか) にあげてみようかな。
やっぱり、Mali は基本的に .net6 ベースだから、.net8 ベースの maui-linux を動かしたいな
Related: https://github.com/jsuarezruiz/maui-linux/issues/94
この Issue の完了に目標を変更しよう

とりあえず Nuget (追記: 一時的なアップロードだし、GitHub Packages のほうがいいか) にあげてみようかな。
やっぱり、Mali は基本的に .net6 ベースだから、.net8 ベースの maui-linux を動かしたいな
Related: https://github.com/jsuarezruiz/maui-linux/issues/94
この Issue の完了に目標を変更しよう
https://github.com/jsuarezruiz/maui-linux/blob/main-linux/eng/pipelines/common/pack.yml これ (Azure Devops 向け) を GitHub Actions 用に調節すれば Pack 部分ができる。あとは、我らが Alice Console (謎の自作構文) の https://github.com/AliceNovel/AliceConsole/blob/main/.github/workflows/nuget.yml を参考にして、Nuget.org にコミットごと+タグごとにリリースさせればいい。

現状 Mali で作業しているけど、maui-linux のほうが新しいデータが入ってていいかも
というか GitHub で現在の状況を公開したほうがいいか…?
面倒だからやってないけど
とりあえず Nuget (追記: 一時的なアップロードだし、GitHub Packages のほうがいいか) にあげてみようかな。
やっぱり、Mali は基本的に .net6 ベースだから、.net8 ベースの maui-linux を動かしたいな
Related: https://github.com/jsuarezruiz/maui-linux/issues/94
この Issue の完了に目標を変更しよう
https://github.com/jsuarezruiz/maui-linux/blob/main-linux/eng/pipelines/common/pack.yml これ (Azure Devops 向け) を GitHub Actions 用に調節すれば Pack 部分ができる。あとは、我らが Alice Console (謎の自作構文) の https://github.com/AliceNovel/AliceConsole/blob/main/.github/workflows/nuget.yml を参考にして、Nuget.org にコミットごと+タグごとにリリースさせればいい。
ってことで、maui-linux (Lemon73 Fork) ですわ。

やっぱこれか?
# install dotnet 6
sudo apt-get update; \
sudo apt-get install -y apt-transport-https && \
sudo apt-get update && \
sudo apt-get install -y dotnet-sdk-6.0
# add keys
wget https://packages.microsoft.com/config/ubuntu/22.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
sudo dpkg -i packages-microsoft-prod.deb
rm packages-microsoft-prod.deb
# install gtksharp with dotnet 6 support
git clone https://github.com/trungnt2910/GtkSharp.git
cd GtkSharp
sudo dotnet tool restore
sudo dotnet cake --BuildTarget=InstallWorkload
# temporary hack for making the templates visible in dotnet new
sudo cp /usr/share/dotnet/template-packs/* /usr/share/dotnet/templates/6.0.5
# install gtk
sudo apt-get install libgtk-3-0
# test gtk template
cd ..
mkdir gtksharptest
cd gtksharptest
dotnet new gtk
dotnet run

これを GitHub Actions 上で試してみるか。
git clone https://github.com/trungnt2910/GtkSharp.git
dotnet cake --BuildTarget=InstallWorkload
PowerShell 上で動いているっぽいので。

これを GitHub Actions 上で試してみるか。
git clone https://github.com/trungnt2910/GtkSharp.git dotnet cake --BuildTarget=InstallWorkload
PowerShell 上で動いているっぽいので。
だめだー

GtkSharp 内で利用されている CI を参考にする?

面倒だけどこの方法を試してみるか

https://github.com/GtkSharp/GtkSharp/wiki/Installing-Gtk-on-Windows
面倒だけどこの方法を試してみるか
msys2 の挙動がよくわからないから一旦諦める。元の方法で試す

ていうか、実機で試してみるか?

実機で動かしてみた感じ
- https://github.com/jsuarezruiz/maui-linux/blob/main/.github/workflows/build-gtk.yml (Linux 向けを Windows 向けに調整して動かす) -> だめ
- https://github.com/GtkSharp/GtkSharp/blob/develop/.github/workflows/main.yml (ビルドして動かす) -> だめ
- https://www.nuget.org/packages/Gtk.Sdk (スクリプト) -> だめ
- https://github.com/GtkSharp/GtkSharp/wiki/Installing-Gtk-on-Windows (msys2 使う) -> 未検証
- (https://www.nuget.org/packages/Gtk4DotNet -> Linux 専用?)
つまり、今までやっていたことは、CI/CD だからエラーになっているというわけではなく、実機でもだめっぽい。
可能なら、GitHub Actions の Windows 上で WSL を動かしたい。それなら Linux のコマンドが使えるから、1の方法ができるはず。(とはいえ、インストールに時間がかかって、CI/CD がかなり遅くなりそうだから非推奨かな…)

可能なら、GitHub Actions の Windows 上で WSL を動かしたい。それなら Linux のコマンドが使えるから、1の方法ができるはず。(とはいえ、インストールに時間がかかって、CI/CD がかなり遅くなりそうだから非推奨かな…)
あるじゃん!!
明日試してみる。WSL でも無理そうなら素直に MSYS2 頑張るか

WSL 厳しそう。msys2 を実機でやって、ci にするか

Reddit でも聞いてみたけど、やはり WSL か Linux 系なら動かせる?そう

どうせ無理だと思うけど、gtk なしで一旦ビルドできるか試してみる?
最終目的はビルドして .nupkg
を nuget.org に上げることなので、その過程については特にこだわりはないし

何故かパスが通せない。から、逆に dotnet をコピーするか...?
でも、さすがに速度が遅くなりそう

何故かパスが通せない。
これだね

ちなみに、MAUI の開発で必須な Microsoft.Maui.Controls
と Microsoft.Maui.Controls.Compatibility
の依存関係は以下

現在の問題は、artifacts
の中に一つも *.nupkg
がないことですわね。
(ls
コマンドを使って見てみても、logs
しかない)

情報がなさすぎるわね

どうやら Windows でもすべてのターゲット向けのコンパイルは厳しいらしい
(.NET MAUI、クロスコンパイルが弱すぎる)
=> Linux でのビルドに切り替えてみる?
あと、dotnet build ./Microsoft.Maui.BuildTasks.slnf
が必要かもしれない。

あとで、実際に利用できるか試してみます。
依存関係的にこの3つだけでは動かないっぽい (もしかしたら全部ビルドする必要あるかも)
あと、なぜか .net6 になってるので、.net8 でビルドしたい
これは eng/Version.props を変えれば良さそう (-dev がついているのはよくわからない)
-dev
は Directory.Build.props
内の <PackageVersion>
で規定されているからっぽい。
(今の作業とは特に関係ないけど)

現在のエラー:
/usr/share/dotnet/sdk/8.0.200/Sdks/NuGet.Build.Tasks.Pack/buildCrossTargeting/NuGet.Build.Tasks.Pack.targets(110,5):
error MSB4018:
System.ArgumentException:
PackageVersion string specified '8.0.40-ci.net8.+sha.59194fc-azdo.' is invalid.
[/home/runner/work/maui-linux/maui-linux/src/Compatibility/Core/src/Compatibility.csproj]
8.0.40-ci.net8
に関しては GitInfo.txt
に記載がある。が、これがどこで利用されているのかがよくわからない。

現在のエラー:
/usr/share/dotnet/sdk/8.0.200/Sdks/NuGet.Build.Tasks.Pack/buildCrossTargeting/NuGet.Build.Tasks.Pack.targets(110,5): error MSB4018: System.ArgumentException: PackageVersion string specified '8.0.40-ci.net8.+sha.59194fc-azdo.' is invalid. [/home/runner/work/maui-linux/maui-linux/src/Compatibility/Core/src/Compatibility.csproj]
見つけた
$(BUILD_BUILDID)
が指定されていないため文字が挿入されず、バージョンの末尾が azdo.
のように .
で終わってエラーになっている。

これでほぼできた
リリース向けも追加
nuget.org へのデプロイは名前がかぶってるから多分できていない (API キーをいれて動かしてみたけど、403エラーなので)

あとは、maui-linux チームと連絡して調整ってかんじかな。
そういえば nuget package がちゃんと動くかわからないので、後で検証するか (github actions の artifacts にでも入れようかな?)

だめかも
わからなくなってきた

kztao 氏の CI が洗練されているので、それを upstream に merge してもらうといいかも

kztao 氏の CI が洗練されているので、それを upstream に merge してもらうといいかも
kztao さんの内容を cherry pick して、自分の変更と合流させた。(これのせいで若干 commit が分かりづらい気がする…)
とりあえず PR: https://github.com/kztao/maui-linux/pull/1
文章とかがめちゃくちゃだけど、ご愛嬌…
返答をお待ちいたしますわ。多分 kztao さんも CI/CD が正常に動いていなくて困っていると思うから、情報共有したいのです。

o, it's not ready for merge.
(https://github.com/kztao/maui-linux/pull/1#issuecomment-2457544682)

最近 .NET MAUI を Linux (WSL2) で動かす動画が公開されたようです: https://www.youtube.com/watch?v=s-clGkUbk84

@lemon73 (私) による PR (バージョンアップ)
Review を待ちます
リポジトリの保持者に Review (Approve) されたのに Merge されない謎

@kztao さんからの PR (Nuget.org に、ベータ版の Packages をアップロードする CI/CD の追加)
何故か Close する @kztao 氏

@kztao さんからの PR (Nuget.org に、ベータ版の Packages をアップロードする CI/CD の追加)
何故か Close する @kztao 氏
再 Open してくれた。
@knocte 氏が担当していると思って Close したっぽい
(なお、Review と Merge してくれない @jsuarezruiz 氏 (maui-linux のリポジトリ管理者))

まあ、Microsoft 社内では Linux への対応が現実的には考えられていないのかな… (少なくとも当時は)
現在はデスクトップにおける Linux のシェア率が 5% に迫ってきているように、再考の価値はありそうですが

実のところを言うと、ここ数日、maui-linux の開発が再燃しているっぽい (本流 (maui-linux) へのコミットや PR は殆どないが、Mali などの Fork にて)
GitHub 上
- @Lemon73 (私) が #94 (プレリリース・リリースを GitHub Actions を使って Nuget.org にリリースする) を対応しようとする
- なんか @kztao 氏がいい感じに途中までできているのを見つけ、上流 (maui-linux) に PR を作成してもらう
- (同時に @Lemon73 も Dependencies のバージョンアップの PR を作成する)
- @webwarrior-ws 氏による Mali への怒涛の PR が始まる (#28, #29, #31, #32)
(ちなみに、ここは結構ややこしいのですが、@webwarrior-ws 氏のリポジトリ は @Iytico 氏の maui の Fork です。が、@knocte 氏の所持する @nblockchain (organization) の Mali に PR を作成しています。つまり下の図のような感じです)
Element (ウェブチャット) 上
- @Lemon73 が maui-linux を WSL2 上で動かす動画を発見し、共有する
- @thomiel 氏の要請により @Iytico 氏が mauil-linux の可能性についての Disscussion を開設する: https://github.com/lytico/maui/discussions/291
- @thomiel 氏が Docker を利用し、開発環境を簡単に整えられる作業を行う (GtkSharp, maui)
という感じ。(GitHub の4と Element の2-3はほぼ同時期 (今から1週間前くらい) です)
どう変わるか…?

どう変わるか…?
何も変わりませんでした。
@jsuarezruiz 氏が Merge してくれません...

@lemon73 (私) による PR (バージョンアップ)
Review を待ちます
リポジトリの保持者に Review (Approve) されたのに Merge されない謎
ということで、私の Fork は Merge されました。
CI/CD に関しては、@jsuarezruiz 氏が Nuget の Key をリポジトリに設定するの待ちって感じですね。
(@jsuarezruiz 氏の対応がやや遅めで、全体的に時間がかかってる気がする。メンテナーが1人しかいないから仕方ないけど、結構困るね)

@lemon73 (私) による PR (バージョンアップ)
Review を待ちます
リポジトリの保持者に Review (Approve) されたのに Merge されない謎
ということで、私の Fork は Merge されました。
CI/CD に関しては、@jsuarezruiz 氏が Nuget の Key をリポジトリに設定するの待ちって感じですね。
(@jsuarezruiz 氏の対応がやや遅めで、全体的に時間がかかってる気がする。メンテナーが1人しかいないから仕方ないけど、結構困るね)
現状は、何待ち?状態。多分 Review 待ちだけど、うーん…
誰もコメントしていないし、年末で忙しいから取り組めていないだけかな?

とりあえず、機能実装に関して検討を行います。
現状簡単そう (私の未熟な技術でもギリギリ開発できそう) なのは Clipboad の実装。
あとは、ListView とか TableView、RadioButton などは必要そう。
Map とかは優先度は低めかな

とりあえず、MAUI のテンプレート (dotnet new maui
) が動かせるのを優先にする?
そうだと、必要そうなのは以下
- ContentPage
- ScrollView (#75: Implement ListView)
- VerticalStackLayout (#68: refactor layout system measuring)
- Image (#69: fix image sizing)
- Label (#73: fix Label sizing)
- Button
ContentPage 以外は基本的に実装が終わってそう? (サイズ調整などは必要そうだけど)

ContentPage 以外は基本的に実装が終わってそう? (サイズ調整などは必要そうだけど)
ContentPage なくね?

これ?

そもそも Page 系は実装が難しそう

とりあえず、現状ビルドすると "net7.0-android
は EOS (End of Support) です"的な内容が表示されるので、プロジェクト全体を .NET 8 の Latest にアップグレードする

error NU1903: Warning As Error: Package 'System.Net.Http' 4.3.0 has a known high severity vulnerability, https://github.com/advisories/GHSA-7jgj-8wvc-jh57
System.Net.Http
に脆弱性が見つかっており、バージョンアップする必要があるけど、どこでバージョン指定しているのかわからない…
System.Net.Http
SystemNetHttp
4.3.0
で全文検索したけど、それらしいのはなさそう

ちなみに、この Merge がうまく行くと、ベース (本流 .NET MAUI) バージョンが .NET MAUI (for Linux) 界隈で一番最新になる (どうでもいい)
Mali とかは未だに .NET6.0 ベースなので…

System.Net.Http に脆弱性が見つかっており、バージョンアップする必要があるけど、どこでバージョン指定しているのかわからない…
System.Net.Http SystemNetHttp 4.3.0 で全文検索したけど、それらしいのはなさそう
っていうか、これは本流では変更されていないのか

一旦、便利なページをまとめる
Useful Resources
Repositories
- .NET MAUI (本家): https://github.com/dotnet/maui
- maui-linux: https://github.com/jsuarezruiz/maui-linux
- (maui-linux/lemon73): https://github.com/Lemon73-Computing/maui-linux
- Mali: https://github.com/nblockchain/Mali
- 実装/GtkSharp: https://github.com/GtkSharp/GtkSharp/tree/develop/Source/Libs
- 参考/Eto: https://github.com/picoe/Eto
Docs
- MSLearn (公式): https://learn.microsoft.com/dotnet/maui/what-is-maui
- GTK API Docs (公式): https://www.gtk.org/docs/apis/
Docker
- maui-linux 向け: https://github.com/Thomas-Mielke-Software/maui-docker
- GtkSharp 向け: https://github.com/Thomas-Mielke-Software/GtkSharp-Docker
Others

@lemon73 (私) による PR (バージョンアップ)
Review を待ちます
リポジトリの保持者に Review (Approve) されたのに Merge されない謎
ということで、私の Fork は Merge されました。
CI/CD に関しては、@jsuarezruiz 氏が Nuget の Key をリポジトリに設定するの待ちって感じですね。
(@jsuarezruiz 氏の対応がやや遅めで、全体的に時間がかかってる気がする。メンテナーが1人しかいないから仕方ないけど、結構困るね)
現状は、何待ち?状態。多分 Review 待ちだけど、うーん…
誰もコメントしていないし、年末で忙しいから取り組めていないだけかな?
された 🎉

Thomas 氏が作成した Docker で作業を進めてみた。
けど、Gtk の表示エラーになるっぽい…
これが解決できれば開発できそう

Thomas 氏が作成した Docker で作業を進めてみた。
けど、Gtk の表示エラーになるっぽい…
これが解決できれば開発できそう
いろいろ試して、1度成功したけど、再現できなかった…
どうしたら動くんだろうか

WSLg のお陰で Windows11 + WSL2 では問題なく動くということはわかっているけど、Docker を使うと動かなくなってしまう。(Docker 外で動かそうとしたけど、それはやや面倒そうな)

Nix とかで自作環境作るほうがいいかな?

開発環境を整えること自体が難関すぎる

Nix とかで自作環境作るほうがいいかな?
とりあえず、maui-linux の CI/CD と Docker を参考に、Nix flake が作れないか試している。
経過段階 (workload の 'gtk' がダウンロードできていない):
{
description = "MAUI Linux with GtkSharp and .NET 8 SDK";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
devShells.${system}.default = pkgs.mkShell {
name = "maui-linux-dotnet-sdk";
buildInputs = [
pkgs.git
pkgs.dotnet-sdk_8
];
shellHook = ''
# Set environment variables for .NET SDK
export GtkSharpVersion=3.24.24.117-develop
export DotnetVersion=8.0.200
# export DOTNET_ROOT=/usr/share/dotnet
export DOTNET_ROOT=$(which dotnet)
export DOTNET_DIR=/nix/store/iggzq5cbp9dxzihm2sg6jsg46044v8pr-dotnet-sdk-wrapped-8.0.407/share/dotnet
# export WORKLOAD_MANIFEST_DIR=$DOTNET_ROOT/sdk-manifests/$DotnetVersion/gtksharp.net.sdk.gtk
export WORKLOAD_MANIFEST_DIR=$DOTNET_DIR/sdk-manifests/8.0.100/gtksharp.net.sdk.gtk
# Clone MAUI Linux repository
echo "## Clone maui-linux repo ##"
if [ ! -d "$HOME/maui-linux" ]; then
git clone https://github.com/jsuarezruiz/maui-linux.git $HOME/maui-linux
fi
cd $HOME/maui-linux
sed -i 's/_IncludeAndroid>true/_IncludeAndroid>/g' Directory.Build.Override.props
echo "## Install Gtk Workload ##"
dotnet nuget add source --name nuget.org "https://api.nuget.org/v3/index.json"
wget https://www.nuget.org/api/v2/package/gtksharp.net.sdk.gtk.manifest-$DotnetVersion/$GtkSharpVersion -O gtksharp.net.sdk.gtk.manifest-$DotnetVersion.nupkg
sudo mkdir -p $WORKLOAD_MANIFEST_DIR
sudo apt install unzip
sudo unzip -j gtksharp.net.sdk.gtk.manifest-$DotnetVersion.nupkg "data/*" -d $WORKLOAD_MANIFEST_DIR/
sudo rm gtksharp.net.sdk.gtk.manifest-$DotnetVersion.nupkg
sudo chmod 764 $WORKLOAD_MANIFEST_DIR/*
dotnet workload search
sudo dotnet workload install gtk --skip-manifest-update
# dotnet build Microsoft.Maui.BuildTasks.slnf
# dotnet build Microsoft.Maui.Gtk.slnf
'';
};
};
}

Nix とかで自作環境作るほうがいいかな?
とりあえず、maui-linux の CI/CD と Docker を参考に、Nix flake が作れないか試している。
とりあえず、進捗だけ
GtkSharp.Workload と https://youtu.be/s-clGkUbk84 を参考に、Nix を作成。
しかし、そこに待ち受けていたのは、昔見た数々のエラーだった!!
{
description = "MAUI Linux with GtkSharp and .NET 8 SDK";
inputs = {
nixpkgs.url = "github:nixos/nixpkgs?ref=nixos-unstable";
};
outputs = { self, nixpkgs }:
let
system = "x86_64-linux";
pkgs = import nixpkgs { inherit system; };
in {
devShells.${system}.default = pkgs.mkShell {
name = "maui-linux-dotnet-sdk";
buildInputs = [
pkgs.git
pkgs.dotnet-sdk_8
pkgs.gtk3
];
shellHook = ''
# Set environment variables for .NET SDK
# export DOTNET_ROOT=/usr/share/dotnet
# export DOTNET_ROOT=$(which dotnet)
# export DOTNET_DIR=/nix/store/iggzq5cbp9dxzihm2sg6jsg46044v8pr-dotnet-sdk-wrapped-8.0.407/share/dotnet
export DOTNET_DIR=$(dirname $(dirname $(which dotnet)))/share/dotnet
echo "## Install Gtk Workload ##"
curl -sSL https://raw.githubusercontent.com/HavenDV/Gtk/main/scripts/workload-install.sh | sudo bash /dev/stdin -d $DOTNET_DIR
dotnet workload list
# echo "## Install GtkSharp ##"
# if [ ! -d "$HOME/GtkSharp" ]; then
# git clone https://github.com/GtkSharp/GtkSharp.git $HOME/GtkSharp
# fi
# cd $HOME/GtkSharp
# sed -i 's/"8.0.100", "8.0.200"}/"8.0.100", "8.0.200", "8.0.300", "8.0.400"}/g' build.cake # add missing version bands
# dotnet tool restore
# dotnet cake --verbosity=diagnostic --BuildTarget=InstallWorkload
# apt update
apt install -y libgtk-3-dev libgtksourceview-4-0
# dotnet new install GtkSharp.Template.CSharp
echo "## Clone maui-linux repo ##"
if [ ! -d "$HOME/maui-linux" ]; then
git clone https://github.com/jsuarezruiz/maui-linux.git $HOME/maui-linux
fi
cd $HOME/maui-linux
sed -i 's/_IncludeAndroid>true/_IncludeAndroid>/g' Directory.Build.Override.props
# optimize for Gtk
sed -i 's/IncludeGtkTargetFrameworks Condition="'$(DotNetGtkWorkloadIsInstalled)' == 'true'">/IncludeGtkTargetFrameworks">/g' Directory.Build.props
sed -i 's/TreatWarningsAsErrors>true/TreatWarningsAsErrors>false/g' Directory.Build.props
sed -i '/<\/ItemGroup>/N; /<\/ItemGroup>\n <ItemGroup Condition=.*TargetFramework.Contains(.*>/d' src/Graphics/src/Graphics.Gtk/Graphics.Gtk.csproj
# build maui-linux
dotnet build Microsoft.Maui.BuildTasks.slnf
dotnet build Microsoft.Maui.Gtk.slnf
# cd src/Controls/samples/Controls.Sample
# dotnet run --framework net8.0-gtk
'';
};
};
}
# 実行
nix develop
# エラー (抜粋)
/nix/store/6gp2czd71cb3n3d2bp7j6j9acifh4hx2-dotnet-sdk-8.0.407/share/dotnet/sdk/8.0.407/Microsoft.Common.CurrentVersion.targets(2176,5): warning : The referenced project '../../../Controls/src/Core/Controls.SourceGen.csproj' does not exist. [/home/lemon73/maui-linux/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj::TargetFramework=net8.0]
/nix/store/6gp2czd71cb3n3d2bp7j6j9acifh4hx2-dotnet-sdk-8.0.407/share/dotnet/sdk/8.0.407/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(215,5): error NETSDK1135: SupportedOSPlatformVersion 3.24 cannot be higher than TargetPlatformVersion 1.0. [/home/lemon73/maui-linux/src/BlazorWebView/src/Gtk/Microsoft.AspNetCore.Components.WebView.Gtk.csproj::TargetFramework=net8.0-gtk]
/nix/store/6gp2czd71cb3n3d2bp7j6j9acifh4hx2-dotnet-sdk-8.0.407/share/dotnet/sdk/8.0.407/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(215,5): error NETSDK1135: SupportedOSPlatformVersion 3.24 cannot be higher than TargetPlatformVersion 1.0. [/home/lemon73/maui-linux/src/BlazorWebView/samples/BlazorGtkApp/BlazorGtkApp.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Clipboard/Clipboard.Gtk.cs(11,19): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(42,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(58,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(71,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(73,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(75,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(79,29): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(103,40): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(110,41): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(289,83): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(298,84): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
1 Warning(s)
13 Error(s)
Time Elapsed 00:00:13.70

あと、この状態でビルドすると、以下のようになる
cd src/Controls/samples/Controls.Sample
dotnet run --framework net8.0-gtk
# エラー
The launch profile "(Default)" could not be applied.
A usable launch profile could not be located.
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(42,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(58,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(71,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(73,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(75,17): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/DeviceDisplay/DeviceDisplay.Gtk.cs(79,29): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(103,40): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Clipboard/Clipboard.Gtk.cs(11,19): error CS0246: The type or namespace name 'Gdk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(110,41): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(289,83): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Essentials/src/Screenshot/Screenshot.shared.cs(298,84): error CS0246: The type or namespace name 'Gtk' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Essentials/src/Essentials.csproj::TargetFramework=net8.0-gtk]
The build failed. Fix the build errors and run again.

問題がありそうな Essensial
を置換しても変化はない、か。
sed -i 's/Include="..\..\..\Essentials\src\Essentials.csproj"/Include="GtkSharp.Maui.Essentials" Version="8.0.40--date20250228-1034.git-cd7b73d"/g' src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj

# add GtkSharp package
cd $HOME/maui-linux/src/Essentials/src
dotnet add package GtkSharp
cd $HOME/maui-linux/src/Core/src # こっちは特に関係ないかも
dotnet add package GtkSharp # こっちは特に関係ないかも
を追加することによって、エラーを減らすことに成功した。(まだ動かないが)
# エラー (抜粋)
/nix/store/6gp2czd71cb3n3d2bp7j6j9acifh4hx2-dotnet-sdk-8.0.407/share/dotnet/sdk/8.0.407/Microsoft.Common.CurrentVersion.targets(2176,5): warning : The referenced project '../../../Controls/src/Core/Controls.SourceGen.csproj' does not exist. [/home/lemon73/maui-linux/src/Controls/samples/Controls.Sample/Maui.Controls.Sample.csproj::TargetFramework=net8.0]
/nix/store/6gp2czd71cb3n3d2bp7j6j9acifh4hx2-dotnet-sdk-8.0.407/share/dotnet/sdk/8.0.407/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(215,5): error NETSDK1135: SupportedOSPlatformVersion 3.24 cannot be higher than TargetPlatformVersion 1.0. [/home/lemon73/maui-linux/src/BlazorWebView/samples/BlazorGtkApp/BlazorGtkApp.csproj::TargetFramework=net8.0-gtk]
/nix/store/6gp2czd71cb3n3d2bp7j6j9acifh4hx2-dotnet-sdk-8.0.407/share/dotnet/sdk/8.0.407/Sdks/Microsoft.NET.Sdk/targets/Microsoft.NET.TargetFrameworkInference.targets(215,5): error NETSDK1135: SupportedOSPlatformVersion 3.24 cannot be higher than TargetPlatformVersion 1.0. [/home/lemon73/maui-linux/src/BlazorWebView/src/Gtk/Microsoft.AspNetCore.Components.WebView.Gtk.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Core/src/Platform/Gtk/WebviewExtensions.cs(2,7): error CS0246: The type or namespace name 'WebKit' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Core/src/Core.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Core/src/Platform/Gtk/MauiWebView.cs(5,28): error CS0246: The type or namespace name 'WebKit' could not be found (are you missing a using directive or an assembly reference?) [/home/lemon73/maui-linux/src/Core/src/Core.csproj::TargetFramework=net8.0-gtk]
/home/lemon73/maui-linux/src/Core/src/Handlers/WebView/WebViewHandler.cs(23,23): error CS0311: The type 'Microsoft.Maui.Platform.MauiWebView' cannot be used as type parameter 'TPlatformView' in the generic type or method 'ViewHandler<TVirtualView, TPlatformView>'. There is no implicit reference conversion from 'Microsoft.Maui.Platform.MauiWebView' to 'Gtk.Widget'. [/home/lemon73/maui-linux/src/Core/src/Core.csproj::TargetFramework=net8.0-gtk]
1 Warning(s)
5 Error(s)
Time Elapsed 00:00:10.30
なお、エラーの上3つはどうでも良い (目的である src/Controls/samples/Controls.Sample.Gtk/Controls.Sample.Gtk.csproj
のビルド時に影響がない) ため、とりあえず無視する。